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

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

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Auto backing up switch configs

Hi,

Is there any way I can automate the backing up of my MDS 9120 and 9216 configurations. Currently when a change is made I manually use the Fabric Manager to tftp the start up and running configs to a tftp server. What I vision is a script where when log I into the switch it runs automatically and backs up all the fabric switches to the tftp server or something simular.

Thanks

Sid

  • Storage Networking
9 REPLIES
New Member

Re: Auto backing up switch configs

Hi,

may be RME does something like You want. Try check - http://cisco.com/en/US/products/sw/cscowork/ps2073/index.html

New Member

Re: Auto backing up switch configs

You can use scheduler command in CLI to setup a set time and day to copy the running or start-up config to TFTP or many choices. See scheduler commands in user guides. very easy to use. Scheduler can automate many funtions, have fun.

Bronze

Re: Auto backing up switch configs

Hi Sid,

If you are using v 2.x of SANos you will be able to use the job scheduler. I have not tested this method at all but it should work.

switch# conf

switch(config)# scheduler enable

switch(config)# scheduler job name backup_configs

switch(config-job)#copy run

tftp://location.of.your.tftp.server.com/switchname.conf

switch(config)# scheduler schedule name daily_config_backup

switch(config-schedule)# job name backup_configs

switch(config-schedule)# time [whenever you want it to happen]

If this does not work or you dont have v2.x of sanos you could always setup a cron job on a unix/linux machine that ssh's to the switch using ssh keys and simply ....

unixhost$ ssh switch show run > switch-config.cfg

The above is the method that I am using at the moment on a 16 switch environment which is still using v1.x sanos.

If you require some info on how to do this just let me know.

Cheers

Andrew

New Member

Re: Auto backing up switch configs

Hello Sid Bartle,

There are two things you need to be aware of :

1 ) Your ftp server should not do authentication and authorization for the switch, otherwise scheduler does not work.

2) To copy the running configuration to a ftp server, you should use the following configuration :

MDS# copy system:running-config ftp://

without "system" keyword does not work.

I made a test for you, uploaded the running config to a tftp server and it worked well.

Here is my config :

# ***** Begin MDS SCHEDULER CONFIG *****#

scheduler enable

scheduler logfile size 16

scheduler job name ekin

copy system:running-config tftp://1.1.1.1

end-job

scheduler schedule name hakan

job name ekin

time start 2005:11:23:20:27 repeat 20:27:0

# ***** End MDS SCHEDULER CONFIG *****#

Arthur# sh scheduler job name ekin

Job Name: ekin

--------------

copy system:running-config tftp://1.1.1.1

==============================================================================

Arthur# sh scheduler schedule name hakan

Schedule Name : hakan

---------------------------

User Name : admin

Schedule Type : Run every 20 Days 27 Hrs 0 Mins

Start Time : Sun Nov 23 20:27:33 2005

Last Execution Time : Yet to be executed

-----------------------------------------------

Job Name Last Execution Status

-----------------------------------------------

ekin -NA-

==============================================================================

Arthur# sh scheduler schedule name hakan

Schedule Name : hakan

---------------------------

User Name : admin

Schedule Type : Run every 20 Days 27 Hrs 0 Mins

Start Time : Sun Nov 23 20:27:33 2005

Last Execution Time : Sun Nov 23 20:27:33 2005

Last Completion Time: Sun Nov 23 20:27:33 2005

Execution count : 1

-----------------------------------------------

Job Name Last Execution Status

-----------------------------------------------

ekin Success (0)

==============================================================================

Arthur# sh scheduler log

Job Name : ekin Job Status: Success (0)

Schedule Name : hakan User Name : admin

Completion time: Sun Nov 23 20:27:33 2005

--------------------------------- Job Output ---------------------------------

`copy system:running-config tftp://1.1.1.1`

Trying to connect to tftp server......

|

TFTP put operation was successful

==============================================================================

And It successfully uploaded the running config to the tftp server.

I hope this helps.

Cheers,

Hakan.

New Member

Re: Auto backing up switch configs

Hakan,

Thanks for the help, much appreciated.

Sid

New Member

Re: Auto backing up switch configs

Hakan,

Is it posible to have the switch create unique names for the save. Like %time%_%date%_%switchname%_cfg.txt.

1645_251105_SW-1_cfg.txt

I could run a script on the tftp server to change the name but I would like to keep thing as simple as posible.

New Member

Re: Auto backing up switch configs

Yes, it is possible.

Issue the commmand as given below :

copy system:running-config tftp://1.1.1.1/1645_251105_SW-1_cfg.txt

Thanks,

Hakan.

New Member

Re: Auto backing up switch configs

sorry I misunderstood..you cannot save the file as you described. I thought you only wanted to change the name of the file.

Cheers,

Hakan.

New Member

Re: Auto backing up switch configs

In SAN-OS 1.x and 2.X, to save the config to a unique name everyday (for example, switch5_) you would need to run the command from a unix host.

$switchname = switch5

$date = `date +%m/%d/%y%`

#ssh show run > $switchname_$date.conf

That would give you a local file of ./switch5_120805.conf

This way you're not overwriting the switch's config on the server every time you backup the config.

337
Views
7
Helpful
9
Replies