Cron Expression Examples: Every 5 Minutes, Hourly, Daily, Weekdays
Copy-ready cron expressions for every 5 or 15 minutes, hourly, daily at a set time, weekdays, weekends, monthly and quarterly, with all 5 fields explained.
The short answer
A standard cron expression has five fields: minute hour day-of-month month day-of-week. Every 5 minutes is */5 * * * *, every day at midnight is 0 0 * * *, and weekdays at 9 AM is 0 9 * * 1-5. The full list of common schedules is below. To check what a simple expression means in plain English, paste it into the cron expression parser.
The five fields
| Position | Field | Allowed values |
|---|---|---|
| 1 | Minute | 0-59 |
| 2 | Hour | 0-23 (24-hour clock) |
| 3 | Day of month | 1-31 |
| 4 | Month | 1-12 |
| 5 | Day of week | 0-6, Sunday = 0 (most cron versions also accept 7 for Sunday) |
Special characters:
*means every value of that field.*/nmeans every n units, starting from 0.*/15in the minute field is minutes 0, 15, 30 and 45.a-bis a range, such as1-5for Monday to Friday.a,b,cis a list, such as9,18for 9 AM and 6 PM.
Every few minutes or hours
| Schedule | Cron expression |
|---|---|
| Every minute | * * * * * |
| Every 5 minutes | */5 * * * * |
| Every 10 minutes | */10 * * * * |
| Every 15 minutes | */15 * * * * |
| Every 30 minutes | */30 * * * * |
| Every hour, on the hour | 0 * * * * |
| Every hour at half past | 30 * * * * |
| Every 2 hours | 0 */2 * * * |
| Every 6 hours | 0 */6 * * * |
A common slip is writing * */2 * * * for "every 2 hours". The * in the minute field makes it run every minute during every second hour. Put a fixed minute first: 0 */2 * * *.
Once or twice a day
| Schedule | Cron expression |
|---|---|
| Every day at midnight | 0 0 * * * |
| Every day at 9 AM | 0 9 * * * |
| Every day at 6:30 PM | 30 18 * * * |
| Every day at 2:15 AM | 15 2 * * * |
| Twice a day, 9 AM and 6 PM | 0 9,18 * * * |
| Every hour from 9 AM to 5 PM | 0 9-17 * * * |
Hours use the 24-hour clock, so 6:30 PM is hour 18, minute 30. There is no AM/PM in cron.
Weekdays, weekends and specific days
| Schedule | Cron expression |
|---|---|
| Weekdays (Mon-Fri) at 9 AM | 0 9 * * 1-5 |
| Every hour, 9 AM to 5 PM, weekdays | 0 9-17 * * 1-5 |
| Weekends at 10 AM | 0 10 * * 6,0 |
| Every Monday at 8 AM | 0 8 * * 1 |
| Every Sunday at midnight | 0 0 * * 0 |
| Every Friday at 5:30 PM | 30 17 * * 5 |
Monthly, quarterly and yearly
| Schedule | Cron expression |
|---|---|
| 1st of every month at midnight | 0 0 1 * * |
| 15th of every month at 9 AM | 0 9 15 * * |
| 1st and 15th at midnight | 0 0 1,15 * * |
| Quarterly (Jan, Apr, Jul, Oct 1st) | 0 0 1 1,4,7,10 * |
| Every 1 January at midnight | 0 0 1 1 * |
*/3 in the month field would start from month 1 and give January, April, July and October as well, but the explicit list is easier for the next person to read.
"Last day of the month" in standard cron
Standard five-field cron has no "last day" symbol. Some schedulers (for example Quartz-style systems) support L, but plain crontab does not. The usual workaround is to run on days 28-31 and let the script exit unless tomorrow is the 1st.
The day-of-month and day-of-week trap
If you restrict both day fields, most cron implementations run the job when either matches, not when both match. So 0 9 13 * 5 runs at 9 AM on the 13th of every month and on every Friday, not only on Friday the 13th.
If you need "only when both are true", schedule on one field and check the other in your script.
Time zones
Cron runs in the time zone of the machine or service running it, which is often UTC on servers and cloud platforms. GitHub Actions scheduled workflows, for example, use UTC. If you are in India (UTC+5:30) and want a job at 9 AM IST on a UTC server, schedule it for 3:30 UTC: 30 3 * * *.
When a job runs at the wrong hour, a time zone difference is the first thing to check. The timestamp converter helps you check what a UTC time looks like locally, and the 5:30 hour error explains the same offset problem with timestamps.
How to check an expression with the parser
0 9 * * 1-5 reads as "at minute 0, at 9:00, on from Mon to Fri".The parser's descriptions are reliable for simple values, steps such as */15 and weekday ranges. For lists or ranges in the hour field, such as 9,18 or 9-17, it currently describes only the first hour, so read that field yourself using the tables above. Use 0 rather than 7 for Sunday in the parser.
Writing the line in crontab
On Linux and macOS, run crontab -e and add one line per job, the expression followed by the command:
0 2 * * * /home/me/backup.sh >> /home/me/backup.log 2>&1
- Use full paths. Cron runs with a minimal environment, so commands that work in your terminal may not be found.
- Redirect output to a log file, as above, so you can see errors.
- Save and exit;
crontab -llists your current jobs.
Common mistakes
* in the minute field of an hourly job. * 9 * * * runs 60 times between 9:00 and 9:59.Frequently asked questions
What is the cron expression for every 5 minutes?
*/5 * * * * runs at minutes 0, 5, 10 and so on, every hour of every day.
How do I run a cron job every day at midnight?
Use 0 0 * * *, which is minute 0 of hour 0 every day, in the server's time zone.
What is the cron expression for weekdays only?
Put 1-5 in the fifth field. For example, 0 9 * * 1-5 runs at 9 AM Monday to Friday.
Is Sunday 0 or 7 in cron?
Sunday is 0. Many cron versions also accept 7 for Sunday, but 0 works everywhere.
Why does my cron job run at the wrong time?
Usually because the server uses a different time zone, often UTC. Convert your local time to the server's time zone before scheduling.
Put this guide into practice with our free online tool — no signup required.
Open tool