Comware Based
1748243 Members
4026 Online
108760 Solutions
New Discussion

5500/5120 automatic config save and export

 
sundoo
Occasional Advisor

5500/5120 automatic config save and export

Hello, 

 

I've got several 5500 EI and 5120 EI switches that I would like to backup automatically every day. The task is to export a version of the running config everyday at let's say 11pm to an external FTP or TFTP server

 

Can someone tell me how to do it ? 

I've found several commands, but none of them really useful: 

 

1.

archive configuration location /flash:/archive filename-prefix switch1

archive configuration interval 1440

archive configuration max 1

The switch has a FTP server activated from which every evening, the external machine downloads the file. 

 

This is how it's actually configured, but it doesn't work quite correctly. The problem is that a reboot of the switchs resets the 1440 minutes period timer(1 day) which is not good. 

 

2. 

There is also the command archive and schedule. I could schedule an archive of the configuration, but this can't be done periodically. i.e. you can't schedule an operation every day at xx:xx but only once.

 

Any help would be appreciated.  

8 REPLIES 8
Alan-WJ
Occasional Advisor

Re: 5500/5120 automatic config save and export

Two things, in terms of the timer and reboots, then you really need to run NTP to resolve this. And  secondaly, IMC can do automated backups,  so you will need to spend some money and purchase it. If you don't want IMC then you will have to start playing around with Freeware SNMP products and do some scripting

Peter_Debruyne
Honored Contributor

Re: 5500/5120 automatic config save and export

Hi,

 

archive is only intended for additional local backup files.

 

Job schedules are what you need:

system-view

job 1-save
 time 1 repeating at 12:00 command save safely force
 time 2 repeating at 12:01 command tftp x.x.x.x put startup.cfg sw1-startup.cfg

You can add more jobs to get this done every hour,

 

Best regards,Peter.

Peter_Debruyne
Honored Contributor

Re: 5500/5120 automatic config save and export

typo, should be:

 

job 1-save
  view monitor
 time 1 repeating at 12:00 command save safely force
 time 2 repeating at 12:01 command tftp x.x.x.x put startup.cfg sw1-startup.cfg

 

 

MichaelM55
Trusted Contributor

Re: 5500/5120 automatic config save and export

Is there any possibility to dynamically add the date to the filename?

 

e.g.

 time 2 repeating at 12:01 command tftp x.x.x.x put startup.cfg sw1-startup.cfg-MM-DD-YYYY

 

paulgear
Esteemed Contributor

Re: 5500/5120 automatic config save and export

An alternative to using IMC is RANCID (http://www.shrubbery.net/rancid/) - there is a plugin for Comware-based switches at https://sites.google.com/site/jrbinks/code/rancid/h3c
Regards,
Paul
sundoo
Occasional Advisor

Re: 5500/5120 automatic config save and export

Hey, thanks to all of you for your replies, 

 

@Peter, 

I just scheduled a job as you explained and gonna check tomorrow to see if it worked. 

 

Thanks a lot

Philippe_D
Advisor

Re: 5500/5120 automatic config save and export

For the people who are interested:
When you use an A5900 with comware 7

The commands are:

 

scheduler job 1-save

command 1 save safely force

 

scheduler job 2-write

command 1 tftp x.x.x.x put startup.cfg sw1-startup.cfg

 

scheduler schedule save

job 1-save

time repeating at 12:00

 

scheduler schedule write

job 2-write

time repeating at 12:01

 

 

 

harpreet21
New Member

Re: 5500/5120 automatic config save and export

HI

 

I have to scheduled the configuration autobackup on H3C switches at every saturday at 22.00 hrs. Please share if it is possible & steps of configuration

 

Regards,

Harpreet Singh