Does anyone have a config that they can share on backing up the running config on RouterA daily at 11pm to a TFTP server? I think it involves the "archive" command.
TFTP Address: 10.8.4.201
Path location and File Name: TFTPBoot\RouterA.txt
Time: Daily at 11pm
Thanks in advance.
Yes, you can use the built-in IOS config archive feature to do this. Your config can be as simple as say:
With this config, the device will write a new file to TFTP with the name HOSTNAME-DATE-X where HOSTNAME is the hostname of the device, DATE is the current date/time, and X is a number from 0 to 14. Config archives will be taken periodically every hour, or whenever a write mem is executed.
Note: most TFTP servers won't like this kind of thing. They require that a file exist before it can be written to. You may want to consider a more secure protocol such as SCP.
There is also a really good Embedded Event Manager policy at http://forums.cisco.com/eforum/servlet/EEM?page=eem&fn=script&scriptId=1103 which will archive the config only when it has changed. It works in conjunction with the above Config Archive feature plus the SYS-5-CONFIG_I syslog message.
With kron you can NOT go to config mode.
It's only for EXEC mode, so it wont let you go to config terminal in KRON:
You should use EEM to achieve this.
event manager applet SaveConfigToTFTP
event cli pattern "write" sync no skip no
action 1 cli command "enable"
action 2 cli command "configure terminal"
action 3 cli command "file prompt quiet"
action 4 cli command "end"
action 5 cli command "copy running-config tftp://tftp-server/router-confg"
action 6 cli command "configure terminal"
action 7 cli command "no file prompt quiet"
action 8 cli command "end"
(write memory|copy running-config startup-config)"
To set a timer, your applet could configure another, timer applet to run. For example:
action 010 cli command "event manager applet mytimer"
action 011 cli command "event timer countdown time 30"
action 012 cli command "action ..."