Cron is the original task scheduler — a small, reliable daemon that has been running scheduled jobs on Unix systems since 1975. Despite being nearly 50 years old, cron remains the default way to schedule recurring tasks on Linux servers, CI/CD pipelines, cloud functions, and container orchestrators. If you work with servers, you will work with cron.

Our free Cron Expression Generator lets you build cron schedules visually and see the next execution times in real time. No signup, no installation — works right in your browser.

What Is Cron & Why It Still Matters

Cron is a time-based job scheduler in Unix-like operating systems. Users define scheduled tasks (called "cron jobs") in a crontab file, and the cron daemon executes them at the specified times. Common use cases include:

Even if you use cloud-native scheduling (AWS EventBridge, Google Cloud Scheduler, GitHub Actions), they all use cron expression syntax. Learning cron once gives you the language for scheduling across every platform.

The 5-Field Cron Syntax

A standard cron expression has 5 fields separated by spaces:

┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 7, Sun = 0 or 7)
│ │ │ │ │
* * * * *  command_to_execute

Each field accepts specific values, ranges, lists, and step values. Here is how a simple expression reads in English:

30 9 * * 1-5
│  │ │ │ │
│  │ │ │ └── Monday through Friday
│  │ │ └──── Every month
│  │ └────── Every day of the month
│  └──────── 9 AM
└───────────  30 minutes past

→ "At 9:30 AM, Monday through Friday"

Special Characters — *, /, -, and Comma

Some cron implementations (like Quartz for Java) support a 6th field for seconds and additional characters like L (last), W (weekday), and # (nth occurrence). Standard Unix cron does not support these extensions.

Common Schedules You Can Copy

# Every minute
* * * * *

# Every 5 minutes
*/5 * * * *

# Every hour at minute 0
0 * * * *

# Every day at midnight
0 0 * * *

# Every day at 9:30 AM
30 9 * * *

# Weekdays at 8 AM
0 8 * * 1-5

# Every Sunday at 2 AM
0 2 * * 0

# First day of every month at midnight
0 0 1 * *

# Every 15 minutes during business hours
*/15 9-17 * * 1-5

# Quarterly: Jan 1, Apr 1, Jul 1, Oct 1 at midnight
0 0 1 1,4,7,10 *

# Every 6 hours
0 */6 * * *

# Twice daily: 8 AM and 8 PM
0 8,20 * * *
Sell Custom Apparel — We Handle Printing & Free Shipping

Edge Cases — DST, Feb 29, Midnight & More

Cron edge cases are where most scheduling bugs hide. Understanding them saves hours of debugging:

Daylight Saving Time (DST)

Cron uses local system time by default. During spring-forward, the clock jumps from 1:59 AM to 3:00 AM — any job scheduled between 2:00 and 2:59 AM will not run that day. During fall-back, the clock goes from 1:59 AM back to 1:00 AM — jobs scheduled in that hour may run twice.

The fix: set your cron daemon's timezone to UTC (TZ=UTC in your crontab) for any job where a missed or duplicate run is unacceptable. This is especially critical for financial processing, billing systems, and data pipeline jobs.

February 29 (Leap Year)

The expression 0 0 29 2 * runs only on February 29 — which means it only executes once every 4 years (or less, since century years that are not divisible by 400 are not leap years). If you need a "last day of February" job, you need a wrapper script that checks the date, because cron has no "last day of month" syntax in the standard 5-field format.

Day of Month + Day of Week Conflict

When both the day-of-month and day-of-week fields are set to specific values (not *), most cron implementations treat them as an OR condition. For example, 0 0 15 * 5 runs on the 15th of every month AND every Friday — not "the 15th when it falls on Friday." This trips up many experienced developers.

Midnight Confusion

Midnight is hour 0, not hour 24. The expression 0 0 * * * runs at midnight (start of the day). There is no hour 24 in cron. If you want "end of day," use 59 23 * * * — one minute before midnight.

Crontab vs. Systemd Timers

Modern Linux distributions offer systemd timers as an alternative to cron. Here is how they compare:

For simple, portable scheduling, cron is still the right choice. For complex service orchestration on modern Linux, systemd timers offer significant advantages.

Cron in Cloud Environments

Cloud providers have adopted cron syntax for their scheduling services:

Debugging Cron Jobs

When a cron job does not fire, systematically check these items:

  1. Syntax: Paste your expression into our cron generator to verify the next run times match your expectations.
  2. Timezone: Check which timezone your cron daemon uses. Run date on the server to confirm.
  3. PATH: Cron runs with a minimal PATH. Always use absolute paths for commands: /usr/bin/python3, not python3.
  4. Permissions: The crontab file must be owned by the right user. Scripts must be executable (chmod +x).
  5. Environment: Cron does not source your shell profile. If your script needs environment variables, define them in the crontab or source them in the script.
  6. Logs: Check /var/log/syslog or /var/log/cron for execution records. Redirect output: command >> /var/log/myjob.log 2>&1.

Try Our Free Cron Expression Generator

Build cron schedules visually, see next execution times, and copy the expression. No signup required.

Open Cron Generator

Frequently Asked Questions

What are the 5 fields in a cron expression?

Minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7, where both 0 and 7 are Sunday). Each field accepts values, ranges, lists, and step values.

What does */5 mean in a cron expression?

It means "every 5 units." In the minute field, */5 fires at 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55 minutes past the hour.

How does cron handle Daylight Saving Time?

During spring-forward, jobs in the skipped hour do not run. During fall-back, jobs in the repeated hour may run twice. Use UTC (TZ=UTC) for critical scheduling.

What is the difference between crontab and systemd timers?

Crontab is the traditional Unix scheduler. Systemd timers offer logging integration, dependency management, resource limits, and persistent run-on-missed-schedule. Crontab is more portable; systemd timers are more powerful on modern Linux.

Can I schedule a cron job for February 29?

Yes — 0 0 29 2 * runs at midnight on Feb 29. It only fires in leap years. For "last day of February" regardless of leap year, use a wrapper script that checks the date.

How do I run a cron job every 30 seconds?

Standard cron's minimum interval is 1 minute. Use two entries: * * * * * command and * * * * * sleep 30 && command. For true sub-minute scheduling, consider systemd timers or a process manager.