cron job every 5 hours
Josh Paetzel
josh at tcbug.org
Fri Jul 13 18:03:39 UTC 2007
On Friday 13 July 2007, Duane Hill wrote:
> On Fri, 13 Jul 2007 at 12:50 -0400, dmehler26 at woh.rr.com
confabulated:
> > Hello,
> > I want to run an updater script, every 5 hours and x minutes. I
> > thought to use:
> >
> > minute 5 * * * root path/to/scriptname
>
> crontab(5):
> ...
> Steps are also permitted after an asterisk, so if you want to
> say ``every two hours'', just use ``*/2''.
> ...
>
> So, my guess would be:
>
> minute */5 * * * root path/to/scriptname
>
Sort of, that would run the cronjob at midnight, 5am, 10am, 3pm, and
8pm so there would be one interval where it runs at 4 hours.
The real method if it's imparitive to run it every 5 hours would be to
set up a cronjob for each day of the week, rotating by one hour.
minute 0,5,10,15,20 * * 0
minute 1,6,11,16,21 * * 1
minute 2,7,12,17,22 * * 2
and so on and so forth
--
Thanks,
Josh Paetzel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20070713/e3194623/attachment.pgp
More information about the freebsd-questions
mailing list