Monday, March 14, 2022

[SOLVED] How to set cron job for bi-weekly (twice a week)

Issue

How do I set a cron job to run twice a week?

I know how to set a cron job for every week:

0 0 * * 0

Solution

How about the following:

0 0 * * 1,4

This sets the day of week to Monday (1) and Thursday (4). You can choose any values 0–7 (both 0 and 7 are Sunday).

For a more readable crontab, you can also use names:

0 0 * * MON,THU

See also: How to instruct cron to execute a job every second week?



Answered By - cmbuckley
Answer Checked By - Cary Denson (WPSolving Admin)