Hi I need to schedule a cron job to run at at 9:00 AM on first Sunday of every month.
Did a little research and see that there is no short hand in cron to this.
Do you know of an optimal way ?
You can put something like that in
00 09 * * 7 [ $(date +\%d) -le 07 ] && /run/your/script
date +%d gives you number of current day and than you can check if the day is lesser or equal of 7. If it is that run your command.
If you run these script only in Sundays it should means that it runs only in the first Sunday of the month.
Remember, that in the
crontab file the formatting options for
date command should be escaped.