Crontab schedule - first thursday of every month

Instead of the first five fields, one of eight special strings may appear:

string	     meaning
------	     \-------
@reboot	     Run once, at startup.
@yearly	     Run once a year, "0 0 1 1 *".
@annually     \(same as @yearly\)
@monthly     Run once a month, "0 0 1 * *".
@weekly	     Run once a week, "0 0 * * 0".
@daily	     Run once a day, "0 0 * * *".
@midnight    \(same as @daily\)
@hourly	     Run once an hour, "0 * * * *".

==================

so based on above

0 0 * 1-12 4 <<< this cron schedule will run at midnight each month on thursday? or will this trigger every thursday every month??

ok found the answer...

zazzybob
Registered Geek

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100

22 09 * 1-12 3 /easdwld/audit/dev/bin/purge.audit

That won't work - that'll run every wednesday. The OP wants the first wednesday of each month.

Cheers
ZB

cron is wierd in this one aspect. The day and date use an 'or' logic. So you can't set it up for first Thursday.

What you gotta do is run a script EVERY Thursday. The first line of the script checks if the date is 1-7. Or have the cron run it each day from 1-7, and have the script check for Thursday.