Basics

Cron Syntax Guide

Linux cron expressions describe recurring schedules with five fields: minute, hour, day of month, month, and day of week.

The 5-field Linux cron format

A standard Linux cron expression uses five space-separated fields. Each field narrows when a command should run.

minute hour day-of-month month day-of-week
*      *    *            *     *

Field values

  • Minute: 0-59
  • Hour: 0-23
  • Day of month: 1-31
  • Month: 1-12
  • Day of week: 0-7, where 0 and 7 are Sunday

Common examples

* * * * *        # every minute
*/5 * * * *     # every 5 minutes
0 9 * * *       # every day at 9:00 AM
0 9 * * 1-5     # weekdays at 9:00 AM
0 0 1 * *       # first day of every month

Common mistakes

  • Using six Quartz fields in a Linux crontab.
  • Writing 24 for midnight instead of 0.
  • Forgetting that day-of-week 0 and 7 both mean Sunday.

FAQ

How many fields are in Linux cron?

Linux cron uses five fields: minute, hour, day of month, month, and day of week.

Can CronTools generate syntax for me?

Yes. Use the Cron Generator to build common schedules visually, then inspect the expression in the Explainer.