Friday, November 22, 2013

Automatic back up of Cisco routers - Kron scheduler

If your are a network engineer, it is a monthly or weekly job to take back up of the router configurations . If it is a small network with a few routers or switches, it is easy to manage. But if it is a large network , It is a hectic job. So I rely on Cisco Kron command.



 Using Kron we can schedule jobs as same as cron in Linux. To store back up, we have to set up a TFTP server. See this blogpost . After setting up TFTP Server, do the following Kron commands in the routers.

Cisco Kron scheduler commands:


kron occurrence monthly at 12:25 05 recurring
  policy-list save-config
!
kron policy-list save-config
  cli copy system:/running-config tftp://10.1.1.1/backup.txt

wherer 10.1.1.1 is the TFTP server IP.

It is like, you make a policy list which includes all the commands to be run. Then configure Kron to call the policy list whenever you want . the general format of the command is as follows:
kron policy-list policyname
commands

kron occurrence occurrence-name [user username] {in[[numdays:]numhours:]nummin| at hours:min[[month] day-of-month] [day-of-week]} {oneshot| recurring| system-startup

For more details, see cisco website and this .