Till recently I didn’t have a decent way to backup configurations from routers and switches without using some kind of management tool, like Cacti or Nagios. I wanted to automatically backup configurations by only using a TFTP or FTP server on a network.
I started looking and found the solution by using the archive and kron configurations. I decided to look for methods to backup configurations when one of the following occurrences happen:
- Somebody enters the save running-config to startup-config command (write memory);
- A certain time of day threshold is reached;
The following example configuration shows both occurrences.
kron occurrence SCHEDULE-TO-BACKUP-CONFIG at 20:00 recurring
kron policy-list BACKUP-CONFIG
cli write memory
The configuration above copies the configuration to TFTP server 192.168.1.100 at 20:00h every day. The configuration is also copied to the TFTP server after issuing a write memory. The syntax of the file name on the TFTP server is hostname-seq.number (e.q. SWITCH01-1, the following file would be SWITCH01-2).
I used it several times now and it works great. I use Tftpd32 as TFTP server on Windows, because it is freeware and can be configured as service.