Friday, July 23, 2010

Command Scheduler KRON Policy

Cisco IOS has a built-in command scheduler called kron .Introduced in cisco IOS 12.3(1)
this command scheduler similar to windows at program and the UNIX cron or at programs.

For Example let's say you want to automatically disable the all debug command after 1 minute.

First,createa kron policy list, essentially .this policy list serves as your "script",which list what 
you want the router to run at the scheduled time ,Here an example :

Router(config)# kron policy-list UNALL 
Router(config-kron-policy)# cli un all
Router(config-kron-policy)# exit 

Next create a kron occurrence ,in which you tell the router when and how often you want
to run this policy list ,Here an example:

Router(config)#kron occurrence UNALL in 00:01 recurring
Router(config-kron-occurrence)#policy-list UNALL

This code sets up your router to disable the all debug command every one minute

Finally,verify that you've entered everything correctly by using the show command:

Router#sh kron schedule
Kron Occurrence Schedule
UNALL inactive, will run again in 0 days 00:00:47

Router#sh kron schedule
Kron Occurrence Schedule
UNALL inactive, will run again in 0 days 00:00:45

Router#sh kron schedule
Kron Occurrence Schedule
UNALL inactive, will run again in 0 days 00:00:44  

 another tip is to run a backup for your router once in a day.

No comments:

Post a Comment