Discussion:
[rancid] Rancid-discuss Digest, Vol 77, Issue 6
Jones, Herschel
2017-03-22 20:02:39 UTC
Permalink
_______________________________________________
Rancid-discuss mailing list
Rancid-***@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Alan McKinnon
2017-03-22 21:42:51 UTC
Permalink
Alan,
Crontab here -
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR
sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
* 1 * * * /usr/local/rancid/bin/rancid-run #hourly router dump
^
This is your problem. It runs every minute when the hour is "1", every
minute from 01:00 to 01:59

I think you got the hours and minutes column swapped, you probably want

0 * * * * /usr/local/rancid/bin/rancid-run #hourly router dump

to run once an hour, on the hour, every hour.
If you really did want rancid to run once a day at 1am, it is this:

0 1 * * * /usr/local/rancid/bin/rancid-run #hourly router dump

The golden rule of cron is you cannot specify intervals like "every 10
minutes" or "once a day". You can only give the exact time when a job
must run. I find it very useful to read the columns as saying for example:

when the big hand is at 0 and the little hand is at 4, then do this :-)
50 23 * * * /usr/bin/find /usr/local/rancid/var/logs -type f -mtime +2
-exec rm {} \;
*Herschel Jones*
Systems Administrator
Meridian Brick LLC*
Office: (706) 821-3684
Mobile: (706) 399-5542
Fax: (706) 722-4774
<http://www.meridianbrick.com/>
1630 Arthern Road Augusta Georgia 30901
http://www.meridianbrick.com
* * Meridian Brick, through its affiliated entities Boral Bricks LLC,
Forterra Brick, LLC, Forterra Brick Ltd./Briques Forterra Ltee. proudly
serves the United States and Canadian markets.
-----Original Message-----
Sent: Wednesday, March 22, 2017 4:00 PM
Subject: Rancid-discuss Digest, Vol 77, Issue 6
Send Rancid-discuss mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific than
"Re: Contents of Rancid-discuss digest..."
1. Rancid Sending Emails Every 2 Minutes (Jones, Herschel)
2. Re: Rancid Sending Emails Every 2 Minutes (heasley)
3. Re: Rancid Sending Emails Every 2 Minutes (Alan McKinnon)
----------------------------------------------------------------------
Message: 1
Date: Tue, 21 Mar 2017 13:43:50 +0000
Subject: [rancid] Rancid Sending Emails Every 2 Minutes
Content-Type: text/plain; charset="us-ascii"
Forgive my newbiness, but hey, I made Rancid work, so that has to say
something. Only issue I am having is with Rancid spamming our network
group when there is a router down. It emails like it is supposed to,
except it does it every ~2 minutes for an hour. That doesn't seem normal
to me, but I couldn't find anything online about it or how to change it.
Thanks in advance for any advice.
Herschel Jones
Systems Administrator
Meridian Brick LLC*
Office: (706) 821-3684
Mobile: (706) 399-5542
Fax: (706) 722-4774
[Loading Image...]<http://www.meridianbrick.com/>
1630 Arthern Road Augusta Georgia 30901
http://www.meridianbrick.com
* * Meridian Brick, through its affiliated entities Boral Bricks LLC,
Forterra Brick, LLC, Forterra Brick Ltd./Briques Forterra Ltee. proudly
serves the United States and Canadian markets.
-------------- next part --------------
An HTML attachment was scrubbed...
<http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20170321/58f1d453/attachment-0001.html>
------------------------------
Message: 2
Date: Wed, 22 Mar 2017 04:24:49 +0000
Subject: Re: [rancid] Rancid Sending Emails Every 2 Minutes
Content-Type: text/plain; charset=us-ascii
Forgive my newbiness, but hey, I made Rancid work, so that has to say
something. Only issue I am having is with Rancid spamming our network
group when there is a router down. It emails like it is supposed to,
except it does it every ~2 minutes for an hour. That doesn't seem normal
to me, but I couldn't find anything online about it or how to change it.
See OLDTIME in rancid.conf(5) and "state" in router.db(%). but, 2 mins
is weird; normally one runs rancid from cron every 1 hour. maybe you
have an MTA problem too.
------------------------------
Message: 3
Date: Wed, 22 Mar 2017 08:49:12 +0200
Subject: Re: [rancid] Rancid Sending Emails Every 2 Minutes
Content-Type: text/plain; charset=utf-8; format=flowed
Forgive my newbiness, but hey, I made Rancid work, so that has to say
something. Only issue I am having is with Rancid spamming our network
group when there is a router down. It emails like it is supposed to,
except it does it every ~2 minutes for an hour. That doesn?t seem
normal to me, but I couldn?t find anything online about it or how to
change it.
What's on your crontab?
--
Alan McKinnon
------------------------------
Subject: Digest Footer
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
------------------------------
End of Rancid-discuss Digest, Vol 77, Issue 6
*********************************************
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Alan McKinnon
***@gmail.com
Alex DEKKER
2017-03-23 11:26:56 UTC
Permalink
Post by Alan McKinnon
Alan,
Crontab here -
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR
sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
* 1 * * * /usr/local/rancid/bin/rancid-run #hourly router dump
^
This is your problem. It runs every minute when the hour is "1",
every minute from 01:00 to 01:59

To the OP - everyone has made this particular mistake at least once :-)
Post by Alan McKinnon
The golden rule of cron is you cannot specify intervals like "every
10 minutes" or "once a day".

Don't want to stray too far off topic here, but "ISC Cron" which
according to the ever-reliable Wikipedia article is the default cron on
most Linux and BSDs allows for just this. My RANCID cron entry is:

29 8-22/4 * * * /usr/bin/rancid-run

so at 29 minutes past every 4th hour between 0800 and 2200, it runs. I
am not sure how this particular frequency was arrived at, but it seems
to work for us.

alexd
Alan McKinnon
2017-03-23 12:11:23 UTC
Permalink
Post by Alan McKinnon
Post by Alan McKinnon
Alan,
Crontab here -
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR
sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
* 1 * * * /usr/local/rancid/bin/rancid-run #hourly router dump
^
This is your problem. It runs every minute when the hour is "1", every
minute from 01:00 to 01:59
To the OP - everyone has made this particular mistake at least once :-)
Post by Alan McKinnon
The golden rule of cron is you cannot specify intervals like "every 10
minutes" or "once a day".
Don't want to stray too far off topic here, but "ISC Cron" which
according to the ever-reliable Wikipedia article is the default cron on
29 8-22/4 * * * /usr/bin/rancid-run
so at 29 minutes past every 4th hour between 0800 and 2200, it runs. I
am not sure how this particular frequency was arrived at, but it seems
to work for us.
That is not actually "very 4 hours", as in "at an interval but I don't
care when it starts"

Your example really does expand to an exact list, wall clock time:
8, 12, 16, 20 o'clock

To understand what Paul Vixie made that value do, it should be
understood like this: for every value between 8 and 22 (inclusive), run
the job at the hour when that value is divisible by 4 without remainder.
Or even start at 8 and keep adding 4 till you go beyond 22

The point I'm making is no matter how fancy you specify your cron
timings, it has to come down a list of exact numbers.

8-22/4 is probably better expressed as "8,12,16,20", more obvious more
intuitive
--
Alan McKinnon
***@gmail.com
Loading...