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 .
Scenario:
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 …
en show running-config | redirect tftp://10.0.0.1/cisco_sw/sw_10.0.0.20.txt
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:
- TFTP SERVER IN WINDOWS IP : 10.0.0.1
- SWITCH IP : 10.0.0.20
Use following commands to add schedule task to run backup daily in midnight
en conf t kron policy-list daily-backup cli show startup-config | redirect tftp://10.0.0.10/cisco_sw/sw_10.0.0.20.txt exit kron occurrence daily-backup at 00:00 recurring policy-list daily-backup exit wr
- 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:
Tips:
(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 en conf term ip ftp username cisco ip ftp password View*pak end en conf t kron policy-list daily-backup cli show startup-config | redirect ftp://192.168.0.1/cisco/MYSWITCHNAME_OR_IP.txt exit kron occurrence daily-backup at 00:00 recurring policy-list daily-backup exit do wr
Regard’s
~Syed Jahanzaib
Why not just use rancid?
LikeLike
Comment by DJ — November 28, 2017 @ 4:40 AM