Cron Syntax and Expression Examples

Understand every Cron field, wildcard and operator with practical examples for hourly, daily, weekly and weekday schedules.

The five Cron fields

minute hour day-of-month month day-of-week
ScheduleExpression
Every minute* * * * *
Every 5 minutes*/5 * * * *
Every hour0 * * * *
Daily at midnight0 0 * * *
Weekdays at 09:000 9 * * 1-5
First day of each month0 7 1 * *

Operators

  • * matches every valid value.
  • , lists values, such as 1,3,5.
  • - defines a range, such as 1-5.
  • / defines steps, such as */15.

Day-of-month and day-of-week behaviour can vary when both are restricted. Check the scheduler documentation and test the result.

More useful schedule examples

GoalExpressionNotes
Every 15 minutes*/15 * * * *Runs at minute 0, 15, 30 and 45
Every day at 06:3030 6 * * *Uses the server's configured timezone
Every Monday at 09:000 9 * * 1Confirm how the target system numbers Sunday
Weekdays at 18:000 18 * * 1-5Monday through Friday
Every Sunday at midnight0 0 * * 0Some systems also accept 7 for Sunday
Every three hours0 */3 * * *Runs when the hour is divisible by three

Cron evaluates each field independently. */15 in the minute field is not the same as waiting 15 minutes after the previous run. It matches fixed points on the clock. Similarly, 0 */3 * * * runs at 00:00, 03:00, 06:00 and so on.

Timezones and missed runs

An expression does not contain a timezone. Traditional Cron normally uses the host timezone, while containers, Kubernetes clusters and managed schedulers may use UTC unless configured otherwise. Daylight saving changes can cause a local time to occur twice or not at all.

Traditional Cron also does not replay a job merely because the machine was offline at the scheduled time. If catching up matters, use a scheduler with missed-run handling or design the task to detect unfinished work.

Validate before deployment

Check the next several run times, test the command independently and confirm the exact Cron dialect. Pay particular attention to midnight, month boundaries, weekdays and daylight saving transitions. For production jobs, log failures and prevent overlapping runs when execution can exceed the interval.

Use the Cron decoder to translate an expression into plain English and preview its next runs.