Three days ago I installed the following crontab job with crontab -e:
# execute weekly
0 2 2-31 * 7 sh /home/user/folder/myscript.sh week > /home/user/.crontablog/crontab.log
It's supposed to be executed every sunday night at 2am except the 1st of the month. However it's executed every night at 2am. What's my mistake? I tried 0 instead of 7 for Sunday with the same result :/
Thank you.
0for Sunday, instead of7? - Steve Summit2-21for the day? Looks like it won't run if the first of the month is a Sunday. - Steve Summit0 2 * * 7to run at 2:00am every Sunday. 7 and 0 are equivalent. (And yes, I use something just like that for once-a-week jobs.) - Dirk Eddelbuettel