buildcron

Cron Expression for Every Tuesday

To run a cron job every Tuesday, use 0 0 * * 2 — once a week at 00:00 on Tuesday. The 2 in the last field is Tuesday, counting from Sunday as 0.

CRON → ENGLISH
0 minute0 hour* day of month* month2 day of week
VALID EXPRESSION

At 12:00am on Tuesday.

0 0 * * 2

Standard 5-field crontab syntax. Day of month and day of week are OR'd when both are set.

NEXT 5 RUN TIMES · local time

What it does

The expression pins the time to 00:00 with its first two fields and restricts only the day of week. The day of month and month stay as *, so every Tuesday qualifies. If a Monday deploy or a Monday-morning backlog makes Monday a bad day for a job, moving it to Tuesday is a one-character change.

Tuesday is a popular day for maintenance precisely because it isn't Monday: the start-of-week rush is over, and there's still most of the week to fix anything that breaks. Teams use it for dependency updates, rotating credentials, applying non-urgent OS patches, or running a weekly cost report once Monday's usage has landed.

Microsoft releases its monthly security updates on the second Tuesday of each month — “Patch Tuesday” — and many ops teams schedule patching around it. Cron can't say “second Tuesday” directly, because restricting both day fields makes them OR together. Run the job every Tuesday and let it check that the date is between the 8th and the 14th: 0 3 * * 2 [ "$(date +\%d)" -ge 8 ] && [ "$(date +\%d)" -le 14 ] && /path/to/patch.

How 0 0 * * 2 works, field by field

FIELDVALUEMEANING
Minute0minute 0
Hour0hour 0 (midnight)
Day of month*every day of the month
Month*every month
Day of week2Tuesday

Put together, cron reads 0 0 * * 2 as: “At 12:00am on Tuesday.

To see further ahead, paste the expression into the cron calculator, which lists the next ten run times and counts how many times the schedule runs in a year.

Frequently asked questions

How do I run a cron job on the second Tuesday of the month?

Schedule every Tuesday and have the command exit unless the date is between the 8th and the 14th — the only range the second Tuesday can fall in. Putting 8-14 in the day of month field doesn't work, since cron ORs it with the day of week.

Is Tuesday 2 in cron?

Yes. Days of the week are numbered 0 to 6 starting with Sunday, so Tuesday is 2. TUE works as well in most implementations.

How do I run a job on Tuesday and Thursday?

List both days in the day of week field: 0 0 * * 2,4 runs at midnight every Tuesday and every Thursday.