run script every last thursday of the month

Open crontab (crontab -e)and add this entry.

0 16 24-31 * 4 script_file

You can use this online cron generator.

Hope this helps.


Faced with the same issue I created a script (cron-last-sunday) to help with this.

Here is a brief example of how easy you can achieve these "peculiar" requirements.

# every first saturday
30 6 * * 6 root run-if-today 1 && /root/myscript.sh

# every last sunday
30 6 * * 7 root run-if-today L && /root/myscript.sh

# every third tuesday
30 6 * * 2 root run-if-today 3 && /root/myscript.sh

Tags:

Schedule

Cron