Cron task - Last Sunday of Month
by orangepeel190 from LinuxQuestions.org on (#55G6N)
Hi All,
I am trying to find a suitable cron entry to run a simple script on my RPi - on the last Sunday of the month.
Can someone check my scripting for the cron??
59 23 * * * [ `date -d tomorrow +%d` -eq '01' ] && (/path/of/script/to/run >/dev/null 2>&1)
Will this run the script at 11:59 on the last Sunday of the month?
#####
Would this work to run a script on the First Tuesday of each month - 5 past midnight?
05 0 1-7 * * [ "$(date '+\%a')" = "Tue" ] && (/path/of/script/to/run >/dev/null 2>&1)
Thoughts/Comments always welcome!
Cheers


I am trying to find a suitable cron entry to run a simple script on my RPi - on the last Sunday of the month.
Can someone check my scripting for the cron??
59 23 * * * [ `date -d tomorrow +%d` -eq '01' ] && (/path/of/script/to/run >/dev/null 2>&1)
Will this run the script at 11:59 on the last Sunday of the month?
#####
Would this work to run a script on the First Tuesday of each month - 5 past midnight?
05 0 1-7 * * [ "$(date '+\%a')" = "Tue" ] && (/path/of/script/to/run >/dev/null 2>&1)
Thoughts/Comments always welcome!
Cheers