Cron jobs to run once a month on 1st Wednesday of each month

Hi expert,

i am new to this.
i a have a Redhat 8 server. i want set up a cron job that run

-script # 1 - on the first Wednesday of every month
and
-script # 2 - on the 3rd week-end of every month.

Thank you in advance.

1 Like

Hi @lamoul,

Run on the first Wednesday every month at 10:10

10  10  1-7 *  *   [ "$(date '+\%a')" = "Wed" ] && /home/USER/My-Wednesday-Script-Name

Cron syntax from How To Add Jobs To cron Under Linux or UNIX - nixCraft :

* * * * * command to be executed
- - - - -
| | | | |
| | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
| | | ------- Month (1 - 12)
| | --------- Day of month (1 - 31)
| ----------- Hour (0 - 23)
------------- Minute (0 - 59)

See Run a perl or shell script cron job on the first Monday or the Nth weekday of the month - nixCraft does it helps?