Syed Jahanzaib Personal Blog to Share Knowledge !

November 27, 2017

Automating Centralized backup for Cisco Switches

Filed under: Cisco Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 12:16 PM


Another day to day troubleshooting short notes:

Disclaimer: There are many other proper techniques to achieve the centralized backup task, like Linux base scripting or FTP base route, But dueto my laziness I made this method according to the already available resources with minimum work required . 


Let’s assume:

Operator have dozen’s of manageable Cisco switches installed at various indoor/outdoor locations. Switches configuration are dynamic & the OP make changes on almost daily basis. For backup of switches configs, OP uses TFTP server on local windows server /& perform backup commands on all switches manually once a month. We want to automate this by having centralized backup server & all switches should run schedule backup task which should upload backup to the TFTP server automatically on daily or weekly basis.

Solution: [for personnel referenec]

1- Install TFTP Server in Windows to receive backup files from devices

Download & install Solarwind free TFTP Server application. Its quite and simple application which can receive backups from your switches/routers/devices and store them in c:\tftp-root folder (default location, you can change it)


At Cisco switch issue following command to test if TFTP is working fine. Your switch must be able to ping/communicate with the tftp server. Login tot switch via terminal or ssh and issue this command to test the TFTP connectivity from switch to tftp server …

show running-config | redirect tftp://

Note: I create new folder name cisco_sw so that all switches configurations should store in a separate folder for easy identification.


2 – Add Backup Schedule Job / Task on Cisco Switches

Network Details:

  2. SWITCH IP :

Use following commands to add schedule task to run backup daily in midnight

conf t
kron policy-list daily-backup
cli show startup-config | redirect tftp://
kron occurrence daily-backup at 00:00 recurring
policy-list daily-backup


  • Verify the kron configuration by using the show command.
show kron schedule
  • Result:
Kron Occurrence Schedule
daily-backup inactive, will run again in 0 days 12:58:04 at 0 :00 on

End Result:



(for specific day and time, use following:

kron occurrence daily-backup at 23:00 Sun recurring)

To run task every 2 minute

kron occurrence daily-backup in 2 recurring
policy-list daily-backup

Copy to TFTP manually / Short Version:

copy running-config tftp

FTP Base backup

At one network, we configured FILEZILLA FTP Server, to make switch upload to FTP, we used following

#JZ # Make sure to change "MYSWITCHNAME_OR_IP.txt" & path to match your switch ip or name / ftp folder

conf term
ip ftp username cisco
ip ftp password View*pak

conf t
kron policy-list daily-backup
cli show startup-config | redirect
kron occurrence daily-backup at 00:00 recurring
policy-list daily-backup
do wr

~Syed Jahanzaib

1 Comment »

  1. Why not just use rancid?


    Comment by DJ — November 28, 2017 @ 4:40 AM

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: