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

john heasley heas at shrubbery.net
Thu Dec 20 18:16:44 UTC 2007


Thu, Dec 20, 2007 at 08:34:24AM -0600, Justin Shore:
> 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

Sorry, I typo'd.  I meant :=, which should provide the value 4 if the
variable is not set.  The point is, if you did not set it your environment
as you've done below, it will set it.

> 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