Cron Twice a Week
Configure a cron job to run twice a week on Monday and Thursday at midnight with 0 0 * * 1,4. Field breakdown and scheduling tips included.
Cron Expression
0 0 * * 1,4
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At 0 |
| Hour | 0 | At 0 |
| Day of Month | * | Every day of the month (1–31) |
| Month | * | Every month (1–12) |
| Day of Week | 1,4 | At Monday, Thursday |
Detailed Explanation
The cron expression 0 0 * * 1,4 schedules a task to run twice per week, on Monday and Thursday at midnight.
Field-by-field breakdown:
0(Minute): At minute 0. The task fires at the start of the hour.0(Hour): At hour 0 (midnight). The task runs at the beginning of each specified day.*(Day of Month): Every day from 1 through 31. No restriction on the day of the month.*(Month): Every month from January through December. No restriction on the month.1,4(Day of Week): Monday (1) and Thursday (4). The comma-separated list selects these two specific days.
This means your task will execute 2 times per week with a 3-day gap followed by a 4-day gap. This Monday-Thursday pattern splits the work week roughly in half, providing two checkpoints that are nearly evenly spaced. It is ideal for semi-weekly reports, database optimization tasks, and periodic security updates. The asymmetric gap means Thursday's run covers one more day than Monday's, which may be relevant for cumulative data processing. This expression is supported by standard cron on Linux/macOS, as well as cloud services like AWS CloudWatch, Google Cloud Scheduler, and GitHub Actions.
Use Case
Commonly used for running semi-weekly database optimization tasks that keep query performance healthy without the overhead of daily execution.
Try It — Interactive Builder
Every Monday, Thursday at 12:00 AM
Next 10 Executions
Ctrl+Shift+C to copy expression