write mem if running-config and startup-config are different?

Arnold Nipper arnold at nipper.de
Mon May 16 21:25:38 UTC 2005

On 16.05.2005 23:00 john heasley wrote

> Mon, May 16, 2005 at 05:05:48PM +0200, Arnold Nipper:
>> On 16.05.2005 16:30 Matt Wilson wrote
>> >Hi-
>> >
>> >We would like to catch and remedy situations where we have altered a 
>> >switch's running-config, but then forget to write mem (weeks later, 
>> >the switch reboots due to power outage, and suddenly vlans aren't 
>> >working, etc).
>> >
>> >Is anyone using rancid to notice that running-config and 
>> >startup-config are different, and if so, issue a write mem command? 
>> >(or something else to address such an issue?)  Would you be willing 
>> >to share what you've done?
>> >
>> Why don't you run "write memory" every time you pick up the config?
> or periodically, somethign like
> 	for r in `cat */router.db | egrep -i '(cisco|cat5)' | cut -f1 -d: `; do
> 	clogin -c 'write mem' $r
> 	done

Be aware that this will fail as both cisco and cat5 expect confirmation 
of the write command. You have to add 2-3 new lines to make it work (2 
for cisco and 3 for cat5 iirc)

Arnold Nipper, AN45

More information about the Rancid-discuss mailing list