Linux – Cron to run every 2nd wednesday

cronlinux

I need to find a way to cron a job so that it runs every second wednesday of the month. Is this possible?

Best Answer

My manpage for crontab (which I sadly can't seem to find online) gives the following example:

# Run on every second Saturday of the month
0 4 8-14 * *    test $(date +\%u) -eq 6 && echo "2nd Saturday"

Adapting this to your purposes...

0 4 8-14 * *    test $(date +\%u) -eq 3 && job.sh