Automatic configuration backup on Cisco Devices with Archive Command

Use Cisco Archive Command to save Configuration

The configuration backup on Cisco Routers and Switches with archive command is very useful for store, organize, restore complete configuration in case of a broken Router and manage an archive of Cisco IOS configuration files in order to enhance the configuration rollback capability by using  the configure replace command if we don’t want changes in configuration. In this example I explained the configuration backup with ftp and tftp servers.

In this tutorial I would explain a different method to backup configuration using archive command. It was Introduced in Cisco IOS Release 12.3(4)T and later versions, the archive command permits to save a copy of the current running configuration to different path: ftp, http, https, rcp, scp, tftp servers. Moreover the archive command has other features, but in this article I would use only two of these:

  • time-period: it sets the time increment for automatically saving an archive file of the current running configuration in the Cisco IOS configuration archive.
  • write-memory: it enable automatic backup generation during write memory; for instance, when I use the ‘write’ command the archive command will be invoked automatically.
Cisco-Router#conf t
Cisco-Router(config)#archive
Cisco-Router(config-archive)#path ?
ftp:    Write archive on ftp: file system
http:   Write archive on http: file system
https:  Write archive on https: file system
rcp:    Write archive on rcp: file system
scp:    Write archive on scp: file system
tftp:   Write archive on tftp: file system

Automatic Configuration backup with FTP Server on Cisco Devices

1.Configure FTP server Username and Password on Router or Switch from global configuration mode.

Cisco-Router#conf t
Cisco-Router(config)#ftp username cisco
Cisco-Router(config)#ftp password cisco

2.Configure FTP server path using archive command.

Cisco-Router(config)#archive
Cisco-Router(config-archive)#path ftp://10.90.10.99/Backup/Cisco-Router-Config

3.There are two ways to backup: manually with write-memory command (using write command each time that you would save running configuration) or automatically with time-period command. For time-period command we have to specify in minutes.

Cisco-Router(config-archive)#write-memory
or
Cisco-Router(config-archive)#time-period 1440

Automatic Configuration backup with TFTP Server on Cisco Devices

1. Configure TFTP server path using archive command.

Cisco-Router(config)#archive
Cisco-Router(config-archive)#path tftp://10.90.10.99/backup/Cisco-Router-Config

2.There are two ways to backup: manually with write-memory command (using write command each time that you would save running configuration) or automatically with time-period command. For time-period command we have to specify in minutes.

Cisco-Router(config-archive)#write-memory
or
Cisco-Router(config-archive)#time-period 1440

Verify the archive command status on Cisco Devices

You can verify archive status with below command and you can find how many times backup has been taken and next backup configuration name etc.

Cisco-Router#sh archive
The next archive file will be named
                   ftp://10.90.10.99/backup/Cisco-Router-Config-14
Archive #  Name
0       ftp://10.90.10.99/backup/Cisco-Router-Config-0
1       ftp://10.90.10.99/backup/Cisco-Router-Config-1
2       ftp://10.90.10.99/backup/Cisco-Router-Config-2
3       ftp://10.90.10.99/backup/Cisco-Router-Config-3
4       ftp://10.90.10.99/backup/Cisco-Router-Config-4
5       ftp://10.90.10.99/backup/Cisco-Router_Config-5
6       ftp://10.90.10.99/backup/Cisco_Router-Config-6
7       ftp://10.90.10.99/backup/Cisco-Router-Config-7
8       ftp://10.90.10.99/backup/Cisco-Router-Config-8
9       ftp://10.90.10.99/backup/Cisco-Router-Config-9
10       ftp://10.90.10.99/backup/Cisco-Router-Config-10
11       ftp://10.90.10.99/backup/Cisco-Router-Config-11
12       ftp://10.90.10.99/backup/Cisco-Router-Config-12
13       ftp://10.90.10.99/backup/Cisco-Router-Config-13<- Most Recent
14      
Cisco_Router#sh archive
The maximum archive configurations allowed is 14.
The next archive file will be named tftp://10.90.10.99/backup/Cisco-Router-Config-6

Archive #  Name

1        tftp://10.90.10.99/backup/Cisco-Router-Config-0

2        tftp://10.90.10.99/backup/Cisco-Router-Config-1

3        tftp://10.90.10.99/backup/Cisco-Router-Config-2

4        tftp://10.90.10.99/backup/Cisco-Router-Config-3

5        tftp://10.90.10.99/backup/Cisco-Router-Config-4

6        tftp://10.90.10.99/backup/Cisco-Router-Config-5<- Most Recent

Find the configuration difference between backup configuration files

To find the configuration differences between two configuration files use the ‘show archive config differences’; for instance, to find the differences between the startup-configuration and the ‘Cisco_Router_Config-12′ file, type:

New_Cisco_Router#show archive config differences nvram:startup-config
    ftp://10.90.10.99/backup/Cisco-Router-Config-12
Loading Cisco-Router-Config-12 !
[OK - 717/4096 bytes] 
Contextual Config Diffs:
+hostname Cisco_Router 
-hostname New-Cisco-Router
New-Cisco-Router#

After finding the configuration differences you can rollback the configuration with configure replace command.

Filed Under: Cisco General

Tags:

About the Author:

RSSComments (4)

Leave a Reply | Trackback URL

  1. Marron says:

    Somebody essentially help to make critically articles I’d state. This is the very first time I frequented your web page and thus far? I amazed with the research you made to create this particular publish extraordinary. Great activity!

  2. Roy says:

    For the routers and switches, the “archive”-command could help you as the devices send the config to your defined host. This can be done for example with SCP or TFTP, server-solutions are freely available. For the ASA keep in mind, that depending in your setup, a backup of the config-file is not enough.

  3. Gayan says:

    Excellent info ! nicely covered on automatic configuration backup on Cisco Routers & Switch with Archive command.

    Thanks 🙂

  4. Sam says:

    Hi and thanks for the great trick, I had configured TFTP and FTP servers with archive command in Cisco Router to get automatic configuration backup and tested.

    Its working fine and thanks

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.