Skip to content

How to read a cron expression without a manual

Cron expressions look like secret codes but follow five simple slots. Learn to read any schedule, recognise common patterns, and write your own with confidence.

By SenangWebsite team3 min read

A developer sets up a report to run every morning and tells you it is scheduled as 0 9 * * 1-5. You nod, then privately wonder whether that means every nine minutes or something more alarming.

Neither, luckily. Cron expressions look encrypted, but they follow one simple pattern that takes about two minutes to learn.

The short answer: a cron expression is five slots in a row, listing the minute, hour, day of month, month, and day of week when a task should run. Stars mean "every", and everything else narrows the schedule down.

What cron is for

Cron is a scheduler built into Linux and similar systems. It runs jobs automatically: backups at night, report emails each morning, cleanups every Sunday. Websites, apps, and hosting panels all use it, which is why the mysterious five-part string keeps appearing in settings screens.

Each scheduled task gets one expression. The system reads it and fires the task at the matching times, over and over, until someone changes it.

The five slots

Every expression has the same five positions, left to right:

Slot Meaning Example
1 Minute (0 to 59) 0
2 Hour (0 to 23) 9
3 Day of month (1 to 31) *
4 Month (1 to 12) *
5 Day of week (0 to 6, Sunday is 0) 1-5

So 0 9 * * 1-5 reads as: at minute 0, at hour 9, on any day of the month, in any month, on weekdays only. In plain English, that is 9:00 in the morning, Monday to Friday. A weekday report, exactly as promised.

The star * is the key to the whole system. It means "every possible value" for that slot. Five stars, * * * * *, means every minute of every day, which is rarely what anyone wants but proves the idea.

Patterns you will see again and again

A handful of expressions cover most real schedules. Recognising these makes you fluent fast:

  • 0 9 * * * every day at 9:00 am
  • 0 9 * * 1-5 weekdays at 9:00 am
  • 0 0 1 * * the first day of every month, at midnight
  • 0 0 * * 0 every Sunday at midnight
  • */15 * * * * every 15 minutes, all day

That last one introduces the slash. When a slot says */15, it means "step through the values in steps of 15", so minutes 0, 15, 30, and 45.

The four special characters

Almost every cron expression you meet uses only four tricks:

  • * means every value.
  • , lets you list values, as in 0,30 for minutes 0 and 30.
  • - gives a range, as in 1-5 for Monday to Friday.
  • / steps through values, as in */10 for every tenth one.

Combine those and you can read nearly anything. 30 8 * 1,6 1 becomes: half past eight in the morning, on Mondays, in January and June. Twice a year Monday reports, if that is really what someone wanted.

Writing your own without the headache

Reading is the easy half. Writing means getting five slots right in the correct order, which is where mistakes creep in, especially because some systems quietly extend the format with a sixth slot for seconds.

The safest habit is to build the expression visually and check the plain-English reading before using it. The Cron Expression Generator on SenangWebsite does exactly that: you pick the schedule, it writes the expression, and it shows a human-readable description plus a cheatsheet of common patterns. Everything runs in your browser, so you can experiment freely.

One last caution when writing your own: cron works on the server's clock. If your server runs in a different time zone than you do, "9:00" may not mean your 9:00. Confirm the server's time zone with whoever manages it, and your morning report will arrive when you actually drink your coffee.

Back to all articles