Toolnova
DeveloperTutorial

Cron Syntax Explained: How to Schedule Any Job in Linux

Cron expressions look cryptic but follow a simple five-field pattern. This guide decodes every part so you can schedule any job without guessing.

TNToolnova Team2 min read

Cron is the Unix task scheduler. It has been running scheduled jobs on servers since 1975, and it is still the backbone of automated maintenance tasks, backup scripts, and data pipelines. The syntax intimidates beginners, but once you understand the five fields, it becomes readable.

The five-field format

A cron expression has five fields, separated by spaces:

* * * * *
│ │ │ │ │
│ │ │ │ └─ Day of week  (0–7, where 0 and 7 = Sunday)
│ │ │ └─── Month        (1–12)
│ │ └───── Day of month (1–31)
│ └─────── Hour         (0–23)
└───────── Minute       (0–59)

A * means "every" — every minute, every hour, every day.

Common examples

Expression Meaning
0 * * * * Every hour, on the hour
0 9 * * * Every day at 09:00
0 9 * * 1 Every Monday at 09:00
0 9 1 * * 1st of every month at 09:00
*/15 * * * * Every 15 minutes
0 9,17 * * 1-5 09:00 and 17:00, Monday to Friday
0 0 * * 0 Every Sunday at midnight

Special characters

  • * — any value
  • , — list (e.g., 1,15 = 1st and 15th)
  • - — range (e.g., 1-5 = Monday through Friday)
  • / — step (e.g., */10 = every 10 units)

Shorthand strings (on most systems)

Shorthand Equivalent Meaning
@hourly 0 * * * * Once an hour
@daily 0 0 * * * Once a day at midnight
@weekly 0 0 * * 0 Once a week on Sunday
@monthly 0 0 1 * * Once a month on the 1st
@reboot — Once at system startup

Building and testing expressions

Instead of trial and error, use the Cron Expression Generator. You describe the schedule in plain English — "every weekday at 8:30 AM" — and it generates the correct cron expression. It also explains any existing expression back to you in plain English.

Common mistakes

  • Forgetting the server's timezone. Cron uses the system timezone. If your server runs UTC, 0 9 * * * fires at 09:00 UTC, not your local time.
  • Using */1 — this is valid but redundant; * alone means "every."
  • Day-of-week vs day-of-month conflict. If both fields are set (not *), cron runs the job when either condition is true — not both.

Once you have the pattern in your head, writing cron expressions becomes second nature.

Explore 285+ free tools

No signup, no watermarks — everything runs privately in your browser.

Browse all tools

Keep reading