What 0 0 * * 4 does
Reading the fields in order: minute 0, hour 0, day-of-month *, month *, day-of-week 4. The job runs at 00:00 on every Thursday, in the server's timezone.
Day-of-week numbering
Cron numbers the week from Sunday: 0 is Sunday, 1 is Monday, through to 6 for Saturday. Confusingly, 7 is also Sunday in most implementations, kept for compatibility. Named abbreviations (SUN, MON, TUE...) work on Vixie cron and Kubernetes but are not universally portable — stick to numbers if you need the expression to work everywhere.
When day-of-month and day-of-week collide
If you set both day-of-month and day-of-week to something other than *, standard cron treats them as OR, not AND. 0 0 1 * 1 runs on the 1st of the month and every Monday — not only on Mondays that fall on the 1st. This surprises almost everyone the first time.
Frequently asked questions
What is the cron expression for every Thursday?
0 0 * * 4 runs at midnight every Thursday. Change the second field to set a different hour.
What number is Thursday in cron?
4. Cron counts day-of-week from 0 = Sunday through 6 = Saturday, with 7 also accepted as Sunday.
Related cron expressions
Browse the full cron expression reference, or build your own expression from scratch.