Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

TCL script - Backup config

I am wanting to write a tcl scrip for the following scenario.  I have two routers at a remote branch that are directly connected and running HSRP.  I would like to have a TCL script that copies the running config over to the other routers flash every so often as a backup.  Anyone done anything like this.  I have basic knowledge of TCL and am tryin to save myself some time and headache.  I guess I'm hoping someone already has a script written for a scenario like this.

Everyone's tags (5)
Cisco Employee

Re: TCL script - Backup config

I don't know of anyone that has done this kind of thing before.  There are quite a few details missing as well.  For example, will this be a bidirectional sync, or will one switch always coopy its config to the other?  I am guessing you will just be using the backup switch as file storage rather than trying to load the primary switch's config on the backup switch.

The easiest solution in my mind is to use the RCP, SCP, or TFTP server on the backup switch, then just copy the config from the primary to the backup.  In that case, a simple EEM applet could do what you want.  For example, to copy the config every day using SCP, you can use the following:

event manager applet sync-config

event timer watchdog time 86400

action 1.0 cli command "enable"

action 2.0 cli command "copy running scp://user:pass@" pattern "Address"

action 3.0 cli command "" pattern "username"

action 4.0 cli command "user" pattern "filename"

action 5.0 cli command "backup-config"

Here, replace user with your username and pass with your password.

CreatePlease login to create content