Crontab cheat sheet
- 1st Thursday of month
# Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) # | | | | | # * * * * * command to be executed 0 15 * * 4 [ $(date +\%d) -le 07 ] && command
- 2nd Thursday of month
# Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) # | | | | | # * * * * * command to be executed 0 15 * * 4 [ $(date +\%d) -ge 8 ] && [ $(date +\%d) -lt 14 ] && command
- 3rd wednesday of month
# Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) # | | | | | # * * * * * command to be executed 5 03 * * WED [ $(date +\%d) -ge 22 ] && [ $(date +\%d) -lt 28 ] && /usr/bin/logger "Test 3rd Wed of month 03:05"
- Reference
https://serverfault.com/questions/986514/crontab-first-wednesday-of-the-month-that-is-followed-by-the-first-monday-of-t
https://stackoverflow.com/questions/58413332/how-to-schedule-a-cron-for-the-first-thursday-of-every-month