Search tools...
Developer Tools

Complete Cron Expression Guide: Syntax, Examples & Best Practices (2026)

Learn cron expression syntax, special characters, common schedules, and best practices. Build any cron job visually with our free generator.

10 min readUpdated April 2, 2026Cron, DevOps, Scheduling, Linux, Automation

Cron expressions are the standard way to define recurring schedules in Unix/Linux systems, CI/CD pipelines, cloud platforms, and job schedulers. Despite being compact and powerful, cron syntax is notoriously difficult to memorize — even experienced developers regularly look up the field order and special characters.

This guide covers everything you need to know: the 5-field format, special characters (*, /, -, ,), real-world examples for common schedules, platform-specific differences (AWS, Kubernetes, GitHub Actions), and best practices for production cron jobs. Use our free Cron Expression Generator to build and validate expressions visually.

Free Tool

Build Cron Expressions Visually — Free & Private

Use the visual builder to create cron expressions, or paste existing ones to decode. Human-readable descriptions, next run times. No signup, no server.

Open Cron Expression Generator →

Cron Expression Syntax: The 5-Field Format

A standard cron expression consists of 5 fields separated by spaces:

┌──────────── minute (0-59)
│ ┌────────── hour (0-23)
│ │ ┌──────── day of month (1-31)
│ │ │ ┌────── month (1-12)
│ │ │ │ ┌──── day of week (0-6, Sunday=0)
* * * * *

Each field accepts numeric values within its range, plus special characters that define patterns:

CharacterMeaningExample
*Every value* * * * * = every minute
,List of values0,15,30,45 * * * * = at minutes 0, 15, 30, 45
-Range of values0 9-17 * * * = every hour from 9 AM to 5 PM
/Step / interval*/10 * * * * = every 10 minutes

These characters can be combined. For example, 0 9-17/2 * * 1-5 means "at minute 0, every 2 hours from 9 AM to 5 PM, Monday through Friday."

Common Cron Expression Examples

Here are the most frequently used cron schedules with explanations:

ExpressionDescription
* * * * *Every minute
*/5 * * * *Every 5 minutes
*/15 * * * *Every 15 minutes
0 * * * *Every hour (at minute 0)
0 0 * * *Every day at midnight
0 9 * * *Every day at 9:00 AM
0 9 * * 1-5Every weekday at 9:00 AM
0 9 * * 1Every Monday at 9:00 AM
0 0 1 * *First day of every month at midnight
0 0 1 1 *Once a year on January 1st at midnight
0 */6 * * *Every 6 hours
30 4 * * 0Every Sunday at 4:30 AM
0 9,18 * * *Twice daily at 9 AM and 6 PM
0 0 15 * *15th of every month at midnight

Use our Cron Expression Generator to build any of these visually and see the next scheduled run times before deploying.

Cron on Different Platforms: AWS, Kubernetes, GitHub Actions

While the core 5-field syntax is universal, different platforms have variations:

Linux/Unix Crontab

The original cron daemon uses the standard 5-field format. Edit with crontab -e. Supports @reboot, @daily, @weekly, @monthly, @yearly shortcuts.

AWS EventBridge / CloudWatch

Uses a 6-field format with an additional year field: minute hour day-of-month month day-of-week year. Also supports ? (no specific value) and L (last) characters. Example: cron(0 9 ? * MON-FRI *) for weekdays at 9 AM.

Kubernetes CronJobs

Uses the standard 5-field format. Defined in YAML manifests under spec.schedule. Timezone support was added in Kubernetes 1.27+ via spec.timeZone.

GitHub Actions

Uses standard 5-field cron in the on.schedule trigger. All times are in UTC. Minimum interval is 5 minutes; GitHub may delay execution during high-load periods.

Quartz Scheduler (Java)

Uses a 6 or 7-field format with seconds and optional year: seconds minutes hours day-of-month month day-of-week [year]. Note the reversed order of the first three fields compared to Unix cron.

Cron Job Best Practices for Production

Cron jobs are critical infrastructure. Follow these best practices to avoid common pitfalls:

  • Always specify timezone: Cron typically runs in the system timezone. If your server is in UTC but your business is in IST, jobs may run at unexpected times. Use timezone-aware schedulers or set the TZ variable.
  • Avoid running at :00: Many cron jobs are scheduled at the top of the hour (0 * * * *), causing load spikes. Offset by a random minute (e.g., 17 * * * *) to distribute load.
  • Use file locks: If a job takes longer than its interval, you can get overlapping runs. Use flock or a lockfile to prevent concurrent execution.
  • Log output: Always redirect stdout and stderr to a log file. Cron silently discards output unless you capture it: */5 * * * * /path/to/script.sh >> /var/log/myjob.log 2>&1
  • Use absolute paths: Cron runs with a minimal environment. Always use full paths for commands and scripts.
  • Monitor failures: Use a dead man's switch service (like Cronitor or Healthchecks.io) to alert you when a scheduled job fails to run.
  • Test with next-run preview: Before deploying, always verify the schedule by checking the next few run times. Our generator shows the next 5 runs automatically.
  • Document your cron jobs: Add a comment above each cron entry explaining what it does and who owns it.

Troubleshooting Common Cron Issues

Cron jobs fail silently more often than you'd expect. Here are the most common issues and fixes:

Job Not Running At All

  • Cron daemon not running: Check with systemctl status cron (systemd) or service cron status.
  • Syntax error: Even one extra space or missing field breaks the entire crontab. Validate with our parser before deploying.
  • Wrong user: System-wide cron (/etc/crontab) has a 6th user field. User crontabs (crontab -e) do not.

Job Runs But Fails

  • Missing environment variables: Cron runs with a minimal PATH. Either set PATH at the top of your crontab or use absolute paths.
  • Permission denied: Ensure the script is executable (chmod +x) and the cron user has permission to access all required files.
  • Working directory: Cron doesn't set a working directory. Use cd /path/to/project && at the start of your command.

Job Runs at Wrong Time

  • Timezone mismatch: Check system timezone with timedatectl. Server UTC vs local time is the #1 cause of "wrong time" issues.
  • DST changes: During daylight saving transitions, jobs scheduled between 2-3 AM may run twice, once, or not at all depending on the system.

How to Use the Tool (Step by Step)

  1. 1

    Open the Cron Expression Generator

    Navigate to the tool — no signup or login required.

  2. 2

    Use the Visual Builder

    Select values for each field (minute, hour, day-of-month, month, day-of-week) using dropdowns. Choose specific values, ranges, steps, or lists.

  3. 3

    Review the Expression

    See the generated cron expression, its human-readable description, and the next 5 scheduled run times.

  4. 4

    Try Quick Presets

    Click a preset button to load common schedules instantly — every minute, hourly, daily, weekly, monthly.

  5. 5

    Parse Existing Expressions

    Paste any cron expression into the parser to decode it, validate it, and see upcoming run times.

Frequently Asked Questions

What is a cron expression?+

A cron expression is a compact string of 5 fields (minute, hour, day-of-month, month, day-of-week) that defines a recurring schedule. It is the standard scheduling format used by Unix/Linux cron, CI/CD tools like GitHub Actions and Jenkins, cloud schedulers like AWS EventBridge, and many job queue systems.

What does */5 mean in a cron expression?+

The */5 syntax means "every 5 units." In the minute field, */5 means every 5 minutes (0, 5, 10, 15...). In the hour field, */5 means every 5 hours (0, 5, 10, 15, 20). The * selects all values, and /5 creates a step interval.

How do I run a cron job every weekday at 9 AM?+

Use the expression 0 9 * * 1-5. The fields mean: minute 0, hour 9, every day-of-month (*), every month (*), Monday through Friday (1-5). You can build this visually using our generator.

What is the difference between 5-field and 6-field cron?+

Standard Unix cron uses 5 fields (minute through day-of-week). AWS EventBridge adds a year field (6 fields), and Quartz Scheduler uses seconds + minutes + hours + day + month + day-of-week (6-7 fields). Our tool uses the standard 5-field format compatible with most systems.

Is my data sent to any server?+

No. All expression building, parsing, and next-run-time calculation runs entirely in your browser using JavaScript. Nothing is uploaded, stored, or tracked.

Can I use day names like MON or month names like JAN?+

Some cron implementations (like Vixie cron and AWS) accept 3-letter names (MON-FRI, JAN-DEC). However, the numeric format (1-5, 1-12) is universally supported. Our tool uses numeric values for maximum compatibility.

Free — No Signup Required

Build Cron Expressions Visually — Free & Private

Use the visual builder to create cron expressions, or paste existing ones to decode. Human-readable descriptions, next run times. No signup, no server.

Open Cron Expression Generator →

Related Guides