11

How to make a script run at e.g. 16:00 every last thursday of the month using gnome-schedule or cron?

user73331
  • 901

2 Answers2

2

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.

devav2
  • 36,312
2

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
MGP
  • 121