Monday, August 20, 2012

Automatically backup your router config

There are many ways to automatically backup a router config

1. SNMP poll from a server
How To Copy Configurations To and From Cisco Devices Using SNMP

2. Use TCL/Expect script from a server
Script to backup Cisco Device Config

3. EEM/Kron policy list on a router
Daily backup

4. Using archive IOS command
How to use archive command to save configuration


I think #4 is the easiest one,  all you need is a FTP server.

877wr1(config)#archive
877wr1(config-archive)#time-period
877wr1(config-archive)#write-memory
path ftp://192.168.1.110/backup/$h

!!$h is the variable of hostname

877wr1(config-archive)#?
Archive configuration commands:
  default       Set a command to its defaults
  exit          Exit from archive configuration mode
  log           Logging commands
  maximum       maximum number of backup copies !! the maximum is 14
  no            Negate a command or set its defaults
  path          path for backups
  rollback      Rollback parameters
  time-period   Period of time in minutes to automatically archive the running-config
  write-memory  Enable automatic backup generation during write memory

877wr1#sh archive
The maximum archive configurations allowed is 14.
The next archive file will be named ftp://192.168.1.110/backup/877wr1-1
 Archive #  Name
   1        ftp://192.168.1.110/backup/877wr1-0 <- Most Recent

No comments:

Post a Comment