Use Kron Tab to run scheduled command

From Internetworkpro

Jump to: navigation, search
This page or section provides device configuration instructions
Please note that the information on this page has not been checked for accuracy and is not intended as a replacement to documentation. Please ensure you understand your desired objectives before attempting to apply any examples listed.
See more examples at Category:Configuration
Here the command to configure Kron ( since IOS ver 12.3(1) )
Router#c
Enter configuration commands, one per line.  End with CNTL/Z.
rtr1-Rack2(config)#
rtr1-Rack2(config)#kron occurrence BACKUP-RUN in 2 recurring
rtr1-Rack2(config-kron-occurrence)#policy-list BACKUP-RUN
Kron: Policy Accepted, Policy needs to be configured
rtr1-Rack2(config-kron-occurrence)#exit
rtr1-Rack2(config)#kron policy-list BACKUP-IN
rtr1-Rack2(config-kron-policy)#cli copy run start
rtr1-Rack2(config-kron-policy)#^Z
rtr1-Rack2#
*Nov 17 12:53:25.107: %SYS-5-CONFIG_I: Configured from console by console
rtr1-Rack2#sh kron schedule
Kron Occurrence Schedule
BACKUP-RUN inactive, will run again in 0 days 00:00:08
rtr1-Rack2#sh run | s kron
kron occurrence BACKUP-RUN in 2 recurring
 policy-list BACKUP-RUN
kron policy-list BACKUP-IN
cli copy running-config startup-config
rtr1-Rack2#

--Lessaid [1]


[edit] Periodical Configuration Saving

Periodical configuration save of Cisco devices can be done from inside the device by using a combination of "kron" and "archive" commands. I usually place the backup on a network path.

Define the location of your configuration save apart from the default Flash location. Based on your IOS support, this can be a HTTP, HTTPS, FTP, or TFTP path. I include the device name and the timestamp:

archive
  path tftp://10.10.10.10/cisco/$h-$t
  write memory

Define the policy list for the scheduler. The following is calling the "write config" command which will trigger the copy over network from the above:

kron policy-list backup-config
  cli write memory

Define the schedule of the policy. The following example is for five minutes past midnight, everyday:

kron occurrence daily-config-backup at 0:05 recurring
  policy-list backup-config

Note: Every time the "write memory" command is issued, the device will trigger a network copy to the path specified above.

--IPv6Freely 09:55, 18 July 2008 (CDT)

Personal tools