cron syntax (leafnode)
Karl Auer
kauer at biplane.com.au
Sun Apr 1 23:47:02 UTC 2012
On Sun, 2012-04-01 at 15:34 -0700, Thufir wrote:
> I want leafnode to run every 65 minutes, or perhaps every hour at 23
> minutes past, or something along those lines.
Every 65 minutes will mean your job will "precess". It will gain 5
minutes every hour, so will not cycle back to its starting point for 12
days (I think).
I don't think you can express that in a single crontab entry - you'll
need lots of entries. However, you could get the same effect by running
a script out of cron every 5 minutes which checks to see if 65 minutes
have elapsed since the last time it was run, runs your actual job if the
time is right, and exits without action otherwise.
A simpler alternative if you just want staggered runs and are not too
fussed about exact times, is to tell cron to run your script every five
minutes, and have your script actually do something only if a random
number between one and 13 (inclusive) equals 1.
> 3 8 * * * * news if [ -x /etc/news/leafnode/do-fetch-news ]; then /
>
> but fetchnews is running every hour.
That means "run at the eight minute of every hour of every day of every
week of every month".
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017
Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20120402/02e8fc72/attachment.sig>
More information about the ubuntu-users
mailing list