Skip to content

Cron Expression Generator

A free crontab generator, calculator and decoder. Build a schedule field by field or paste an expression to decode it: you get it in plain English and the next run times. For example, 30 2 * * 1-5 means at 02:30 on weekdays. Copy the crontab line when it looks right.

Free · No signupCalculated in your browser

Cron expression generator

Quick set

Paste an expression to decode it, or build one field by field below.

At 09:00, on weekdays.

Hour 0–23

Next runs

Cron uses the server’s time zone. Check it with timedatectl.

Cron runs with a short PATH, so use full paths such as /usr/bin/python3.

Paste into crontab -e
0 9 * * 1-5 /path/to/command

Getting the generator ready…

Scheduled jobs on your servers

Schedule them in CtrlOps without crontab syntax.

CtrlOps Cron Jobs lists the jobs already in your crontab, and one click adopts a job without changing its schedule. Every run is logged with its output, and a failed run sends a Slack, Telegram or webhook alert, even with the app closed. 14-day free trial, no credit card required. How Cron Jobs works.

Explore cron jobsDownload for MacDownload for Windows

Keep it handy

Common cron expressions,
in plain English.

Each description comes from the same reader as the generator above, so the table and the tool always agree. Times are in the server’s time zone.

Common cron expressions, when they run and what they are used for
ExpressionRunsOften used for
*/5 * * * *Every 5 minutes.Health checks, queue workers
*/15 9-17 * * 1-5Every 15 minutes between 09:00 and 17:45, on weekdays.Business-hours polling
0 * * * *Every hour, on the hour.Hourly reports, log rotation
0 */6 * * *At 00:00, 06:00, 12:00 and 18:00, every day.Syncs and cache refreshes
30 2 * * *At 02:30, every day.Nightly backups, off-peak work
0 9 * * 1-5At 09:00, on weekdays.Weekday digests and reminders
0 3 * * 0At 03:00, on Sunday.Weekly clean-ups
0 0 1 * *At 00:00, on the 1st of the month.Monthly invoices and archives
0 0 1 1,7 *At 00:00, on the 1st of the month, in January and July.Twice-yearly certificate or key reviews
@rebootOnce, each time the server starts.Start a process when the server boots

How cron reads it

How a cron expression works,
field by field.

What is a cron expression?

A cron expression is a line of five fields that tells cron when to run a job: minute (0–59), hour (0–23), day of the month (1–31), month (1–12 or JAN–DEC) and day of the week (0–7 or SUN–SAT, where 0 and 7 are both Sunday). A job runs in every minute that matches all of them.

How to decode a cron expression

Read the five fields from left to right and say each one in words: minute, hour, day of the month, month, day of the week. A * means every value, so it adds no limit. Or paste the expression into the generator above, which reads it for you and lists the next runs.

  1. 0 9 * * 1-5 reads “At 09:00, on weekdays.”
  2. */15 9-17 * * 1-5 reads “Every 15 minutes between 09:00 and 17:45, on weekdays.”
  3. 0 0 13 * 5 reads “At 00:00, on the 13th of the month and every Friday.”

Special characters

* matches every value. A comma lists values, as in 9,17. A hyphen makes a range, as in 1-5. A slash adds a step: */15 is every 15th value and 9-17/2 is every second hour from 9 to 17. Characters such as ?, L and # belong to Quartz schedulers, not Linux cron.

Day of the month vs day of the week

When both day fields are restricted, cron runs on days that match either one, so 0 0 1 * 1 runs on the 1st and on every Monday. If either day field starts with *, both must match. The generator shows the rule cron will actually apply.

Shortcuts like @daily

@hourly, @daily, @weekly, @monthly and @yearly stand for 0 * * * *, 0 0 * * *, 0 0 * * 0, 0 0 1 * * and 0 0 1 1 *. @reboot runs once when the server starts.

Install and check the job

Add the crontab line with crontab -e, or run the install command, which keeps your existing jobs. List them with crontab -l. Cron runs commands with a short PATH and no shell profile, so use full paths and save the output to a log to see failures. To see whether a job fired, run grep CRON /var/log/syslog on Debian and Ubuntu, or journalctl -u cron.

Common cron mistakes

A % in the command must be escaped as \%, or cron reads it as a new line. A job with no log fails in silence, so add >> /var/log/job.log 2>&1. And cron uses the server’s time zone, so a schedule set for your local time can run hours off, and daylight saving time can shift it.

Read the crontab(5) reference

Before you schedule

Cron,
explained.

What does */5 * * * * mean?

It runs every 5 minutes. The */5 in the minute field means "every 5th minute" (0, 5, 10, ... 55), and the four asterisks mean every hour, every day of the month, every month, and every day of the week.

How do I run a cron job every N minutes or hours?

Use a step value with /. Every 10 minutes is */10 * * * *; every 2 hours is 0 */2 * * *. The step applies to the field it is in, so put it in the minute field for minutes and the hour field for hours.

How do I run a cron job every day at midnight?

Use 0 0 * * *, or the shortcut @daily. The first 0 is the minute and the second is the hour, so the job starts at 00:00 in the server’s time zone. For a quieter hour, change the hour field: 0 3 * * * runs at 3 AM.

Why does my schedule with both day-of-month and day-of-week run too often?

Because cron treats them as OR when both are set: the job runs whenever either field matches. For example 0 0 13 * 5 runs on the 13th of every month AND every Friday. To target a weekday within a month, leave day-of-month as *.

How do I run a job only on weekdays?

Use 1-5 in the day-of-week field, e.g. 0 9 * * 1-5 runs at 9 AM Monday through Friday. Day-of-week is 0-7 where both 0 and 7 are Sunday, so Monday is 1 and Friday is 5.

Why did my cron job not run?

The usual causes are: cron has a minimal PATH so binaries are not found (use absolute paths), the command produced an error you never saw (redirect output to a log with >> file 2>&1), the script is not executable, or the timezone differs from what you expected. Check the cron log with grep CRON /var/log/syslog.

What is @reboot?

@reboot runs a command at startup rather than on a time schedule. It is handy for starting a process or warming a cache. The exact startup behavior depends on your cron implementation; it does not provide recurring run times for the preview.

What timezone does cron use?

By default, the system/server timezone. Some implementations, including Cronie, let you pin a crontab to a specific zone with CRON_TZ at the top of the file (for example CRON_TZ=UTC). Check that your cron implementation supports it. The next-run preview in this tool lets you pick a timezone so you can see times in whatever zone your server uses.

What is the difference between a cron job and a systemd timer?

A cron job runs a command on a schedule and does little else: no retries, no dependencies, and output only if you redirect it. A systemd timer starts a systemd service instead, so its output goes to the journal and, with Persistent=true, it catches up on a run the server missed while it was off. Use cron for simple recurring jobs. For a timer, the systemd service generator writes the service and the timer.

How do I get an alert when a cron job fails?

Add MAILTO=you@example.com at the top of the crontab and cron emails whatever a job prints, as long as the server can send mail. So make the job print only when something goes wrong. CtrlOps Cron Jobs can alert you in Slack, Telegram or a webhook when a job fails or times out, even with the app closed.

Keep exploring

Guides and documentation to go further.

Your privacy preferences. We use product analytics to improve CtrlOps. Google measurement runs without analytics cookies. Live chat stays off until you allow it. Cookie policy