[rancid] Re: Rancid and TFTP?

Rob Skoog rskoog at chrr.osu.edu
Thu Apr 3 17:25:33 UTC 2008

> This is slightly off-topic, but I'd appreciate any input from others who 
> may have encountered the same issue.
> I run a customer proof of concept lab and I am a happy user of RANCID 
> and CVSWeb.  I like being able to view old configs from various 
> engagements, see diffs, etc.  The one missing element is the ability for 
> me to log into a remote Cisco device and do a simple "copy tftp flash" 
> in order to load an older configuration from the server running RANCID.  
> Since RANCID doesn't store complete configs, I can't figure out a way to 
> do this.
> Has anyone developed a way to archive configs with RANCID and still be 
> able to easily tftp complete configs to a remote device?  I can't seem 
> to figure this out.  Or, are there other opensource tools that would 
> fill this need? 
> Thanks.
> ------------------------------------------------------------------------
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss

I've thought about doing this before, but haven't yet.  you could use a 
shell script with clogin to do it though through cron.

Something like: (untested)

#pull config
clogin device -c "copy flash tftp:\\ip\newConfig.txt"
#compare to previous config
if ! diff TFTPROOT\newConfig.txt TFTPROOT\CurrentConfig.txt
#config is different
then date=$(date --iso-8601=seconds)
#archive old config
mv TFTPROOT\CurrentConfig.txt ARCHIVE\config.$date.txt
#make new config current
mv TFTPROOT\newConfig.txt TFTPROOT\CurrentConfig.txt
#config is the same
else rm TFTPROOT\newConfig.txt

Anyways, I think you get the idea...  You could probably even check it 
into CVS as mentioned by Andrew if you wanted to get really ambitious. 
I'm not sure though how you could pull existing information from the CVS 
rancid makes and load it directly as a config.  Someone else with more 
rancid+cvs knowledge might be able to answer your question better.

Rob Skoog

More information about the Rancid-discuss mailing list