Re: crontab

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




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.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux