On Mon, May 14, 2012 at 5:21 PM, Frank Murphy <frankly3d at gmail.com> 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.
Pádraig pointed out the right solution. BTW, I generally avoid using
user crontabs and instead use system crontabs to manage services. It
fits in easier with slack or puppet for managing servers. The
downside is that system crontabs are not checked at all. I wrote the
following which would have warned on the above crontab (if it was in
the seven field system crontab format):
http://code.google.com/p/chkcrontab/
Kevin
--
Kevin Lyda
Dublin, Ireland
US Citizen overseas? We can vote.
Register now: http://www.votefromabroad.org/
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!