Auto Backup Configurations
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.
archive
path tftp://192.168.1.100/C2960-01/$h
write-memory!
kron occurrence SCHEDULE-TO-BACKUP-CONFIG at 20:00 recurring
policy-list BACKUP-CONFIG
!
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.
René Jorissen
Latest posts by René Jorissen (see all)
- MacOS Big Sur and SSLKEYFILELOG - November 23, 2021
- ClearPass, Azure AD, SSO and Object ID - August 12, 2021
- ClearPass – custom MPSK - July 20, 2021
thankz Works like a charm.
Is there any simalar for HP / Aruba Switches?
I am not sure if there is something similar in AOS / AOS-CX. CX has the concept of checkpoint, but I use the features of AirWave, Aruba Central or NetEdit for config management.
You can search the internet for scripts in Python, Ansible or PowerShell for automatic backups.