This was a find for me since I’ve always had to manually backup my IOS images to a TFTP server usually running on my desktop. With this new feature introduced in IOS 12.3(1) it is now possible to create policy based command sets that can be executed by the IOS's scheduler.
So let’s say you want to backup your running configuration every day on Sunday at 11PM, here is how you would do that.
From configuration mode:
R2(config)#kron policy-list SystemBackup
R2(config-kron-policy)#cli write
R2(config-kron-policy)#cli cli show run | redirect tftp://10.1.1.1/test.cfg
R2(config-kron-policy)#exit
R2(config)#kron occurrence SystemBackup at 23:00 Sun recurring
R2(config-kron-occurrence)#policy-list SystemBackup
The cli commands are limited to those that do not require user interaction so keep that in mind and it is why the show run command was used rather than something like copy running-config tftp://10.1.1.1/test.cfg which requires line input to execute.
To see your new kron job:
R2#sh run | beg kron policy-list backupsystem
!
kron policy-list backupsystem
cli write memory
cli cli show run | redirect tftp://10.1.1.1/test.cfg
To see your kron schedule:
R2#sh kron schedule
R2#sh kron schedule
!
Kron Occurrence Schedule
systembackup inactive, will run again in 2 days 22:32:42 at 23:00 on Sun
Additional information:
http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_tech_note09186a008020260d.shtml#ab
Additional information:
http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_tech_note09186a008020260d.shtml#ab
No comments:
Post a Comment