Search tools...
Developer Tools

Cron Expression Generator Guide: Schedule Tasks Like a Pro (2026)

How cron expressions work, common patterns, and visualizing schedules — for developers, sysadmins, and DevOps.

7 min readUpdated April 24, 2026Developer, DevOps, Linux, Scheduling

Cron expressions are the universal language for scheduling automated tasks — running database backups every night, sending weekly reports, polling APIs every 5 minutes. They look cryptic ("0 0 * * *") but follow simple rules once you understand the format.

This guide explains the 5-field cron syntax, common scheduling patterns, special characters, and tips for testing schedules safely before production.

Free Tool

Generate Cron Expressions — Free

Visual schedule builder with next-execution preview. Perfect for backups, reports, and automation.

Open Cron Generator ->

Cron Syntax (5 Fields)

* * * * *
| | | | |
| | | | +---- Day of week (0-7, Sunday=0 or 7)
| | | +------ Month (1-12)
| | +-------- Day of month (1-31)
| +---------- Hour (0-23)
+------------ Minute (0-59)

Special Characters

  • * — every value
  • , — list (1,5,15)
  • - — range (1-5)
  • / — step (*/5 = every 5)
  • ? — no specific value (some systems)
  • L — last day of month/week
  • W — weekday closest to date

Common Cron Patterns

ScheduleCron Expression
Every minute* * * * *
Every 5 minutes*/5 * * * *
Every hour0 * * * *
Every day at midnight0 0 * * *
Every day at 3:30 AM30 3 * * *
Every Monday at 9 AM0 9 * * 1
Every weekday at 6 PM0 18 * * 1-5
1st of every month0 0 1 * *
Every 15 minutes during work hours*/15 9-17 * * 1-5
Twice daily (8 AM, 8 PM)0 8,20 * * *

Special Cron Strings

StringMeaningEquivalent
@yearlyOnce a year0 0 1 1 *
@monthlyOnce a month0 0 1 * *
@weeklyOnce a week0 0 * * 0
@dailyOnce a day0 0 * * *
@hourlyOnce an hour0 * * * *
@rebootAt system startup(varies)

Common Cron Mistakes

  • Forgetting time zone — cron uses server time; specify in code if needed
  • Day of week 0 vs 7 — both = Sunday; 1=Monday in standard cron
  • Long-running tasks overlapping — if task takes 6 minutes and runs every 5, multiple instances overlap
  • Not redirecting output — silent failures; always log stderr/stdout
  • PATH issues — cron has minimal PATH; use absolute paths
  • Off-by-one in day-of-month — Feb 30 doesn't exist
Test in Staging First

A cron set to "*/1 * * * *" instead of "0 */1 * * *" runs every minute, not every hour — easy 60x oops. Use scheduling visualizers to verify intent before deploying.

How to Use the Tool (Step by Step)

  1. 1

    Pick Schedule Frequency

    Every X minutes, hourly, daily, weekly, monthly.

  2. 2

    Set Specific Times

    Hour, minute, day of week, day of month.

  3. 3

    See Generated Expression

    Tool builds cron string from your inputs.

  4. 4

    Visualize Schedule

    See next 5-10 execution times to verify intent.

  5. 5

    Copy and Test

    Add to crontab or scheduler. Test in staging before production.

Frequently Asked Questions

How do I add a cron job in Linux?+

`crontab -e` opens your user crontab in editor. Add line, save. Job activates immediately.

Where do cron job logs go?+

By default to system mail. Best practice: redirect output: `* * * * * /command >> /var/log/myjob.log 2>&1`

Can cron run jobs every second?+

No, minimum is 1 minute. For sub-minute scheduling, use a script that loops with sleep, or systemd timers.

What if my server is down at scheduled time?+

Standard cron skips missed runs. Use anacron for laptop/intermittent systems that should "catch up" on missed runs.

How to schedule based on time zone?+

Standard cron uses server time. Set TZ environment variable in crontab: `TZ=Asia/Kolkata`

What is `@reboot`?+

Runs the job once when system boots. Useful for starting daemons, cleaning temp files on startup.

Free — No Signup Required

Generate Cron Expressions — Free

Visual schedule builder with next-execution preview. Perfect for backups, reports, and automation.

Open Cron Generator ->

Related Guides