Running cron jobs on first weekday of month

Posted on 06-03-2019 by Nadir Latif

Source: https://sysadminspot.com/linux/cron-to-run-on-first-specified-day-of-the-month/

To run a cron job on the first weekday of every month for example first Wednesday of each month, the following cron job entry can be used:


0 0 * * Wed [ `date +\%d` -le 7 ] && command-to-run

The above cron job will be run on first Wednesday of each month


Leave a Comment:

Search