On 05/14/2012 05:21 PM, Frank Murphy wrote:
> crontab -e:
> 0 6 * * 2 [ `date +%e` -gt 1 -a `date +%\e` -lt 7 ] && <MY COMMAND>
>> Have I the backslash in the correct place?
>> Trying to do 1st Tuesday of each month.
You need to escape both of the % above
(note % is converted to \n otherwise).
Now you don't need both date commands,
so this should work:
0 6 * * 2 [ $(date +\%e) -le 7 ] && <MY COMMAND>
For details see: man 5 crontab
cheers,
Pádraig.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!