cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
784
Views
20
Helpful
3
Replies

Recommendations for backing up switch configs

pendal8286
Level 1
Level 1

Hello all and thanks for your time and expertise.  I work for an employer where time and resources are always limited so I've backed up our switch configs via a local TFTP server.  The problem is this process is time consuming and we have a fair number of switches.  Please let me know what product (or process) you would recommend to make my life easier relative to backing up our switch configs.  Definitely willing to consider paying for a solution that is straight forward and gets the job done.  Thank you very much for any advice and recommendations.  We have mostly Cisco 3560G switches.  

3 Replies 3

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

The solution with the owest overhead would be to write your own (python) script to log onto the device and copy the running config, or have the device initiate the copy to a remote location. 

 

If scripting is not your area of expertise (there will be plenty of example scripts online...), then with a little bit of setup (or a docker container if you prefer) I would recommend using Ansible for this task. There are well established modules for config management (cisco.ios.ios_config module – Module to manage configuration sections. — Ansible Documentation) and again plenty of examples online. Take this one for example, which incorporates version control:

Backup Cisco Configuration by Ansible | by Razan Saad | Medium

or something slighly simpler:

GitHub - sanakess/ansible-cisco-backup: Ansible Cisco backup template

 

cheers,

Seb.

Leo Laohoo
Hall of Fame
Hall of Fame
archive
 log config
  logging enable
  hidekeys
 path tftp://<TFTP_IP_ADDRESS>/config/$h-
 write-memory
 time-period 10080

Try this.  

There are two ways to "back-up" the config: 

  1. If someone saves the config, a copy is sent to the TFTP server.  The filename is the name of the client plus the date-n-time stamp. 
  2. One week (time-period 10080) after the last time someone has save the config.  

Hello,

you could also use an EEM script that makes a backup each time the configuration actually changes. Below is a sample.

event manager applet BACKUP_CONF_TFTP
event syslog pattern "%SYS-5-CONFIG_I: Configured from"
action 0.01 info type routername
action 1.01 cli command "enable"
action 1.02 cli command "show clock"
action 1.03 regexp "(2[0-3]|[01][0-9]):([0-6][0-9]):([0-6][0-9])" "$_cli_result" time hour minute second
action 1.04 puts "$time"
action 1.05 puts "$hour"
action 1.06 puts "$minute"
action 1.07 puts "$second"
action 1.11 cli command "show clock"
action 1.12 regexp "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([1-9]|0[1-9]|[1-2][0-9]|3[0-1]) (20[1-9][0-9])" "$_cli_result" time2 month day year
action 1.13 puts "$time2"
action 1.14 puts "$month"
action 1.15 puts "$day"
action 1.16 puts "$year"
action 2.01 cli command "configure terminal"
action 2.02 cli command "file prompt quiet"
action 2.03 cli command "do copy run tftp://10.0.0.10/$_info_routername-$year$month$day-$hour$minute$second.txt"