Jump to content

Recommended Posts

Posted

Hi,

 

I am trying to backup my switch configs, and want to do it with the 'job' command to run at a specific time.

 

My command is:

 

copy tftp startup-config 10.x.x.x 10.x.x.x-aruba.cfg (without the x's of course)

 

Job is called 'Backup'

 

Job Information Job Name : Backup Runs At : 23:00 Config Save : Yes Repeat Count : -- Job Status : Enabled Running Status : Active Run Count : 99 Error Count : 99 Skip Count : 0 Command : copy tftp startup-config 10.x.x.x 10.x.x.x-aruba.cfg Last Run Time : Tue May 25 23:00:00 2021

 

 

OK, if I run this command on the switch, it comes up with:

 

Device may be rebooted, do you want to continue [y/n]? n

 

So, I don't want to really reboot my switches on backup, so is there a way around this? Also, if I run this as a Job command, how would I pipe a 'N' as an answer?

 

Many thanks, apols if this is the wrong group, just couldn't see a networking/switch one.

Posted (edited)

Isn't that because you have your command the wrong way around?

 

You're copying tftp "to" startup so you're asking it to overwrite the live config

 

Don't you want copy startup-config "to" tftp so it does it the other way around

 

Steve

Edited by Steve21
  • Thanks 1
Posted

Agree with Steve. The command you present here will copy *to* running config, not backup your config.

 

The command should look more like this template:

copy < startup-config | running-config > tftp < ip-addr > < remote-file >

For example, copy startup-config tftp 10.28.227.105 d:\configs\sw8200 will backup startup-config to a tftp server on 10.28.227.105, saving it to the path d:\configs\sw8200

Posted
If you don't mind me saying, I think you are going about this the wrong way. This sort of problem should be handled using an 'infrastructure as code' methodology - keep all of your configs in a git repository and to backup that repository. This method has several advantages: You can see who has made changes to a configuration, the configuration is version controlled, you can rollback configurations. Then, periodically, apply these configurations to your switches with a configuration management tool. If anyone makes unauthorised changes directly on the switch they will be overwritten with the correct configuration.
Posted (edited)
If you don't mind me saying, I think you are going about this the wrong way. This sort of problem should be handled using an 'infrastructure as code' methodology - keep all of your configs in a git repository and to backup that repository. This method has several advantages: You can see who has made changes to a configuration, the configuration is version controlled, you can rollback configurations. Then, periodically, apply these configurations to your switches with a configuration management tool. If anyone makes unauthorised changes directly on the switch they will be overwritten with the correct configuration.

 

You're not wrong but (without wishing to be disrespectful to the OP) I suspect that someone who's struggling to get a TFTP backup working at all needs to master the basics before going down this road. If we're talking about a more structured approach then HP/Aruba actually have a product available that will handle all this, allow you to schedule changes, collect monitoring data and remediate issues, install firmware out of hours, all that good stuff and that's probably where I'd be pointing people in an ideal world.

Edited by Roberto
Posted
I suppose. I'd just try and teach people the 'right' way to do things. Nobody ever has time to go back and fix things!. It's also a really good methodology for servers and cloud systems too - and any place that has more than 100+ servers will look for these skills.
Posted

The OPs command does look to be the wrong way round (which is problably the answer they need).

 

The Idea of using Git etc is an interesting one, but get that wrong and you would loose the site/infrastructure so need to be VERY careful in the inital setup.

 

I use Rancid to collate the configs, which then puts the changes into a repository. That gives you the what changed when, and allows roll back, but doesn't move the master copy.

 

I think a long time ago @Ric had a blog post on here on how to configure Rancid, at least thats where I think I pinched my starting point from.

 

- - - Updated - - -

 

The OPs command does look to be the wrong way round (which is problably the answer they need).

 

The Idea of using Git etc is an interesting one, but get that wrong and you would loose the site/infrastructure so need to be VERY careful in the inital setup.

 

I use Rancid to collate the configs, which then puts the changes into a repository. That gives you the what changed when, and allows roll back, but doesn't move the master copy.

 

I think a long time ago @Ric had a blog post on here on how to configure Rancid, at least thats where I think I pinched my starting point from.

Posted (edited)
I suppose. I'd just try and teach people the 'right' way to do things. Nobody ever has time to go back and fix things!. It's also a really good methodology for servers and cloud systems too - and any place that has more than 100+ servers will look for these skills.

 

I am employed in a senior role by a global financial organisation, almost entirely with cloud products these days, and work in the way you describe. Literally 99.9% of everything I do is a template or a script under change and source control. But I still think that a solution to the OP’s current problem is a perfectly fine answer. There’s nothing wrong with solving today’s problems today and doing so is the quickest route to getting the OP able to backup their switch configs to something. Steve and I supplied that, and I’m perfectly happy with my answer.

 

I actually agree with your overall point but I think you’re letting perfection be the enemy of good here.

Edited by Roberto
Posted

hmmm, ok. The issue was that I was missing startup-config before the tftp command, which was a typo as I had already had the command running on one switch.

 

The correct command, in conf mode is:

 

job Backup at 23:40 "copy startup-config tftp 10.x.x.x 10.x.x.x-aruba.cfg"

 

exit/save

 

This works. Not sure what the other chatter on this thread was about, but just point out the syntax error, and letting me know the right one would have been just fine. Have a good day.

Posted

This works. Not sure what the other chatter on this thread was about, but just point out the syntax error, and letting me know the right one would have been just fine. Have a good day.

 

it was just about understanding the fundamentals of disaster recovery, your welcome :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...