Re: [gentoo-user] cron - once a month during week days

2015-02-06 Thread Alan McKinnon
On 05/02/2015 22:49, Rich Freeman wrote: On Thu, Feb 5, 2015 at 2:43 PM, Alan McKinnon alan.mckin...@gmail.com wrote: I was under impression that it will run once a month on Monday but it seems to be running every day, why? Basically, what you want to do cannot be done in a plain crontab.

Re: [gentoo-user] cron - once a month during week days

2015-02-06 Thread Neil Bothwick
On Fri, 6 Feb 2015 13:42:45 -0500, Walter Dnes wrote: #!/bin/bash xdate=`date +d` if [ 10#${xdate} -le 7 ]; then do_whatever fi Note a booby trap here. `date +d` returns a 2-digit number, padded with a leading zero if necessary. Use date +%e, which uses a space instead of a zero

Re: [gentoo-user] cron - once a month during week days

2015-02-06 Thread Rich Freeman
On Fri, Feb 6, 2015 at 3:12 AM, Alan McKinnon alan.mckin...@gmail.com wrote: On 05/02/2015 22:49, Rich Freeman wrote: On Thu, Feb 5, 2015 at 2:43 PM, Alan McKinnon alan.mckin...@gmail.com wrote: I was under impression that it will run once a month on Monday but it seems to be running every

Re: [gentoo-user] cron - once a month during week days

2015-02-06 Thread Walter Dnes
On Thu, Feb 05, 2015 at 12:19:13PM -0700, Joseph wrote I have a cron tab entry: 8 12 1-7 * 1 rsync ... I was under impression that it will run once a month on Monday but it seems to be running every day, why? Here's a possible workaround; have the script run every Monday, but also have

Re: [gentoo-user] cron - once a month during week days

2015-02-05 Thread Rich Freeman
On Thu, Feb 5, 2015 at 2:43 PM, Alan McKinnon alan.mckin...@gmail.com wrote: I was under impression that it will run once a month on Monday but it seems to be running every day, why? Basically, what you want to do cannot be done in a plain crontab. You might be able to leverage anacron to

[gentoo-user] cron - once a month during week days

2015-02-05 Thread Joseph
I have a cron tab entry: 8 12 1-7 * 1 rsync ... I was under impression that it will run once a month on Monday but it seems to be running every day, why? -- Joseph

Re: [gentoo-user] cron - once a month during week days

2015-02-05 Thread Florian Gamböck
Hi Joseph! Am 05.02.2015 um 20:19 schrieb Joseph: I have a cron tab entry: 8 12 1-7 * 1 rsync ... From `man 5 crontab`: 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

Re: [gentoo-user] cron - once a month during week days

2015-02-05 Thread Alan McKinnon
On 05/02/2015 21:19, Joseph wrote: I have a cron tab entry: 8 12 1-7 * 1 rsync ... I was under impression that it will run once a month on Monday but it seems to be running every day, why? As Florian explained, crontab syntax gets weird when you use fields 3 and 5. Basically, what you