[CentOS] crontab

Nicolas Thierry-Mieg Nicolas.Thierry-Mieg at imag.fr
Thu Jul 7 12:24:48 UTC 2011



Helmut Drodofsky wrote:
>
>
> I would like to run a program at 2:35 at the first Saturday of each odd
> month.
>
> My solution:
>
> 35 2 1-7 1,3,5,7,9,11 6 /bin/program
>
> The program was executed yesterday = Wednesday = day 3, cron ignores the
> day of the week!

not ignoring, OR-ing:
$ man 5 crontab
<snip>
Note: The day of a command’s execution can be specified by two fields — 
day  of  month,  and day  of  week.   If  both fields are restricted 
(ie, aren’t *), the command will be run when either field matches the 
current time.  For example, "30 4 1,15 * 5" would cause a command to be 
run at 4:30 am on  the  1st  and  15th  of  each month, plus every Friday.
<snip>

don't know if there's a cleaner solution than using only eg saturday in 
cron and having a wrapper script for your program to check that it's the 
first week of a month.



More information about the CentOS mailing list