[rancid] Re: Setting $OLDTIME per RANCID group or device

Justin Shore justin at justinshore.com
Thu Dec 20 14:34:24 UTC 2007


john heasley wrote:
> Wed, Dec 19, 2007 at 07:24:10PM -0600, Justin Shore:
>> I have a need to define $OLDTIME (or disabling the feature) per group or 
>> individual device.  I have a number of unreliable remote sites (owner 
>> residences, roving demo kits, etc) that are only up occasionally.  I'd 
>> like to not get the alerts from RANCID for just those particular device 
>> or the RANCID group that the devices belong to.  Is there an easy way to 
>> do this?  If it helps, I poll individual groups with rancid-run rather 
>> than simply running rancid-run with no arguments.  ie,
>>
>> 0 */1 * * * rancid-run abc
>> 0 */1 * * * rancid-run def
>> 0 */1 * * * rancid-run remote
>>
>> Can I simply define $OLDTIME on the CLI in my crontab on the specific 
>> crontab entries that need to be changed and then let the default OLDTIME 
>> in the config file take over to all the other entries?
> 
> yes, if you change the definition in rancid.conf, if you use it, to
> something more like
> 
> 	OLDTIME=${OLDTIME:-whatevervalueyouuse}

John,

Thanks for the reply.  I'm familiar with bash syntax to append to a 
variable (like PATH) but I can't think of any syntax to replace the 
value of a variable if the environment value has already been defined, 
except with a an if statement.  Is that what you have above does?

So I could modify my rancid.conf to read

OLDTIME=${OLDTIME:4}; export OLDTIME

That would give me a default value of 4 hours overall for the majority 
of my gear.  Then, in my crontab I can do

0 */1 * * * rancid-run site-a
0 */1 * * * rancid-run site-b
0 */1 * * * export OLDTIME=99999999; rancid-run remote

The lengthy time would effectively prevent OLDTIME from running for that 
one single RANCID group.  Am I understanding what you're saying correctly?

Thanks
  Justin


More information about the Rancid-discuss mailing list