Complete Guide 5 min read

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.

cron expression examplescron every 5 minutescron job every day at midnightcron weekdays onlycrontab syntax

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

PositionFieldAllowed values
1Minute0-59
2Hour0-23 (24-hour clock)
3Day of month1-31
4Month1-12
5Day of week0-6, Sunday = 0 (most cron versions also accept 7 for Sunday)

Special characters:

  • * means every value of that field.
  • */n means every n units, starting from 0. */15 in the minute field is minutes 0, 15, 30 and 45.
  • a-b is a range, such as 1-5 for Monday to Friday.
  • a,b,c is a list, such as 9,18 for 9 AM and 6 PM.

Every few minutes or hours

ScheduleCron expression
Every minute* * * * *
Every 5 minutes*/5 * * * *
Every 10 minutes*/10 * * * *
Every 15 minutes*/15 * * * *
Every 30 minutes*/30 * * * *
Every hour, on the hour0 * * * *
Every hour at half past30 * * * *
Every 2 hours0 */2 * * *
Every 6 hours0 */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

ScheduleCron expression
Every day at midnight0 0 * * *
Every day at 9 AM0 9 * * *
Every day at 6:30 PM30 18 * * *
Every day at 2:15 AM15 2 * * *
Twice a day, 9 AM and 6 PM0 9,18 * * *
Every hour from 9 AM to 5 PM0 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

ScheduleCron expression
Weekdays (Mon-Fri) at 9 AM0 9 * * 1-5
Every hour, 9 AM to 5 PM, weekdays0 9-17 * * 1-5
Weekends at 10 AM0 10 * * 6,0
Every Monday at 8 AM0 8 * * 1
Every Sunday at midnight0 0 * * 0
Every Friday at 5:30 PM30 17 * * 5

Monthly, quarterly and yearly

ScheduleCron expression
1st of every month at midnight0 0 1 * *
15th of every month at 9 AM0 9 15 * *
1st and 15th at midnight0 0 1,15 * *
Quarterly (Jan, Apr, Jul, Oct 1st)0 0 1 1,4,7,10 *
Every 1 January at midnight0 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

  • Open the cron expression parser.
  • Type or paste the expression, with exactly five fields separated by spaces. If there are more or fewer, the tool shows an error.
  • Read the Plain English line. For example, 0 9 * * 1-5 reads as "at minute 0, at 9:00, on from Mon to Fri".
  • Click a preset (every hour, daily at 9 AM, weekdays at 9 AM, every 15 minutes and others) to load a working example and edit it.
  • 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 -l lists your current jobs.

    Common mistakes

  • A * in the minute field of an hourly job. * 9 * * * runs 60 times between 9:00 and 9:59.
  • 12-hour thinking. 6 PM is 18, not 6.
  • Forgetting the server's time zone. Many servers run in UTC.
  • Both day fields set. They usually combine with OR.
  • Six fields pasted into a five-field cron. Some tools add a seconds field at the start; standard crontab does not have one.
  • 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.

    Try this tool on Lazyblink

    Put this guide into practice with our free online tool — no signup required.

    Open tool