Cisco - Make a backup of running configuration and copy it to a FTP server periodically





Use an FTP Server to Backup the Configuration

1. At the Router> prompt, issue the enable command, and provide the required password when prompted.
   The prompt changes to Router#, which indicates that the router is now in privileged mode.
2. Configure the FTP username and password.
 
Switch#config terminal
Switch(config)#ip ftp username test
Switch(config)#ip ftp password test123
Switch(config)#end
Switch#

3. Create a backup and copy the running-configuration into a ftp server. If you have correctly set the ftp user and password, you will get an output as follows.

Switch#copy running-config ftp://xxx.xxx.xxx.xxx/running-config.txt
Address or name of remote host [xxx.xxx.xxx.xxx]?
Destination filename [running-config.txt]?
Writing running-confix.txt !
3267 bytes copied in 1.484 secs (2201 bytes/sec)
Switch#

4. You have to use Kron to backup the configuration periodically. Here in this case, backup process must not be interactive.
   You can use the following command to create backup and copy it to FTP server automatically witout any interactive session.

Switch#show running-config | redirect ftp://xxx.xxx.xxx.xxx/running-config.txt
Switch#

5. Create a new backup policy for the backup job.

Switch (config)#kron policy-list Backup
Switch (config-kron-policy)#cli show running-config | redirect ftp://xxx.xxx.xxx.xxx/running-config.txt
Switch (config-kron-policy)#end

6. Create a Kron occurrence named 'Daily-Backup' to run on daily at 00:00. Also add the kron policy in this kron job.

Switch (config)#kron occurrence Daily-Backup at 00:00 recurring
Switch (config-kron-occurrence)#policy-list Backup
Switch (config-kron-occurrence)#end
Switch #

You can check the status of Kron using the following command.

Switch #sh kron schedule
Kron Occurrence Schedule
Backup inactive, will run again in 0 days 03:18:44 at 0 :00 on


You can check the current running configuration using  the following command. You can find the Kron job settings in the running configuration.
You can find a portion of kron as like follows when running the following command.

Switch #show running-config
.
.
.

kron occurrence Daily-Backup at 0:00 recurring
 policy-list Backup
!
kron policy-list Backup
 cli show
 cli show running-config | redirect ftp://xxx.xxx.xxx.xxx/running-config.txt
!
kron policy-list backup
!
.
.
.


Verify if the Kron job successfull copied the back in the remote server.

Note:-

You can modify the cronjob to run on different time.
To remove commands from the policy-list,

Switch(config)#kron policy-list Backup
Switch(config-kron-policy)#no  cli show running-config | redirect ftp://xxx.xxx.xxx.xxx/running-config.txt
Switch(config-kron-policy)#end


Reference:
http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_tech_note09186a008020260d.shtml

This entry was posted by Arun Ghosh. Bookmark the permalink.