Cron expression explainer

Type or paste a cron expression. You’ll see what it means and when it runs next, in your time zone. It’s read exactly the way Heartcron reads schedules.

Every 5 minutes.

Next runs

What each field means

FieldValueMeaning
Minute*/5every 5th minute
Hour*every hour
Day of month*every day
Month*every month
Day of week*any day of the week

Know when it doesn’t run

Cron never tells you when a job fails to start or dies halfway. Add a ping at the end of the line: if Heartcron doesn’t hear it on schedule, you get an alert in Telegram, Slack, Discord or email.

*/5 * * * * /path/to/job.sh && curl -fsS -m 10 --retry 3 https://ping.heartcron.com/<check-id> > /dev/null

Monitor this job for free How pings work

Cron syntax

┌───────────── minute (0–59)
│ ┌─────────── hour (0–23)
│ │ ┌───────── day of month (1–31)
│ │ │ ┌─────── month (1–12)
│ │ │ │ ┌───── day of week (0–6)
│ │ │ │ │
* * * * *
SymbolMeaningExample
*Any value* * * * *
,A list of values0 8,20 * * *
-A range of values0 9 * * 1-5
/A step: every Nth value*/15 * * * *
@dailyA shortcut for a common schedule@hourly, @weekly, @monthly, @yearly

Months can be written as JAN–DEC and days of the week as SUN–SAT. Sunday is 0.

Questions

What time zone does cron use?

System cron runs in the server’s time zone, which is often UTC. Check it with the date command. In Heartcron you choose the time zone for each check, so 0 3 * * * can mean 3 AM in New York.

What if both day of month and day of week are set?

Then the job runs when either one matches, not both. 0 0 1 * 1 runs on the 1st of every month and on every Monday.

How do I run a job every 90 minutes?

One expression can’t do it, because steps reset every hour. Use two lines: 0 0-21/3 * * * and 30 1-22/3 * * *.

How do I know my cron job actually ran?

Add a request to a monitoring URL at the end of the job. Heartcron expects it on schedule and alerts you when it’s late or the job reports a failure.

Common schedules