cron job every 5 hours

Olivier Nicole on at cs.ait.ac.th
Mon Jul 16 04:27:41 UTC 2007


>     I want to run an updater script, every 5 hours and x minutes. I thought 
> to use:
> 
> minute 5 * * * root path/to/scriptname
> 
> but that looks like it only works once a day, i want it to go every 5 hours 
> not justa at 5 in the monrning.

You could sechedule you jor at 5, 10, 15 and 20 on monday, then 1, 6,
11, 16 and 21 on Tuesday and etc, but as the number of hours per week
is not a multiple of 5, next week Monday would be at 2, 7, 12, 17 and
22, and that would not work with cron.

If you absolutely need it to be 5 hours (6 hours would work nicely
with cron) have your job restart itself with at(1).

Cron must work on a weekly sechedule.

bests,

Olivier


More information about the freebsd-questions mailing list