Cron Expression Builder

Build cron expressions step-by-step with interactive interface. Construct complex cron schedules by selecting minutes, hours, days—validates syntax automatically.

Why Use Cron Expression Builder

Complex cron schedules like "every 15 minutes between 9 AM-5 PM on weekdays" require precise syntax that's easy to get wrong. This interactive builder breaks cron creation into simple steps—select minute interval, choose hour range, pick weekdays—and assembles correct expression automatically. Essential for building advanced schedules with ranges and intervals, learning cron syntax through visual feedback, or debugging existing expressions by rebuilding them step-by-step to understand what each field does.

  • Step-by-step construction: Build expression field by field with guidance
  • Syntax validation: Prevents invalid combinations before generating
  • Range and interval support: Easy creation of complex patterns (*/15, 9-17, 1-5)
  • Expression breakdown: Shows what each part means in plain English
  • Live preview: See actual run times as you build

Step-by-Step Tutorial

  1. Build schedule: "Every 15 minutes, 9 AM to 5 PM, weekdays"
  2. Step 1: Minutes → Select "Every 15 minutes" → */15
  3. Step 2: Hours → Select "Range 9-17" → 9-17
  4. Step 3: Days → Select "Every day" → *
  5. Step 4: Months → Select "Every month" → *
  6. Step 5: Weekdays → Select "Monday-Friday" → 1-5
  7. Final: */15 9-17 * * 1-5
  8. Preview confirms: Runs 9:00, 9:15, 9:30... 16:45, 17:00 on weekdays only

Real-World Use Case

An operations team needs health check script running "every 5 minutes during business hours (8 AM-6 PM) on weekdays, but every 30 minutes on weekends". They build first expression: */5 8-18 * * 1-5 (weekday schedule). Then second: */30 * * * 0,6 (weekend schedule). The builder's validation prevents mistakes like */5 8-18 * * * (would run nights too) or 0,5,10 8-18 * * 1-5 (misses minutes 15-55). Preview confirms expected run frequency. Deploying two cron jobs with validated expressions ensures monitoring coverage matches business requirements.

Best Practices

  • Start with minute field—most schedules have specific minute requirements
  • Use ranges (9-17) instead of lists (9,10,11,12...) for readability
  • Test with preview—verify schedule matches business intent
  • Document built expressions with comments explaining purpose
  • For overlapping schedules, use separate cron jobs rather than complex OR logic

Common Mistakes to Avoid

  • Confusing day-of-week numbering: Sunday=0, not 7 (though 7 works in some systems)
  • Forgetting hour is 0-23: 2 PM is 14, not 2
  • Not considering timezone: Cron runs in server timezone
  • Complex day logic: day-of-month AND day-of-week creates OR condition

Privacy and Data Handling

Expression building happens client-side. No schedule data uploaded. Generated cron expressions contain only timing information—no sensitive data about what's being scheduled.

Frequently Asked Questions

How do I create "every X minutes" cron expressions?

Use step syntax: */5 = every 5 minutes, */15 = every 15 minutes. Place in minute field: */5 * * * * runs every 5 minutes, 24/7. For "every 5 minutes during business hours": */5 9-17 * * 1-5. Builder has "every X minutes" option making this easy—just select interval and hour range.

Can I combine multiple conditions like "every Monday and Wednesday"?

Yes, use commas: 0 9 * * 1,3 = 9 AM on Mondays and Wednesdays. For ranges with gaps, combine: 0 9 * * 1-3,5 = Mon/Tue/Wed/Fri. Builder has "select multiple days" option. Can't do complex AND logic ("first Monday AND 15th of month")—requires scripts.

What does it mean when day-of-month and day-of-week are both specified?

Cron treats it as OR condition: 0 9 1 * 1 runs "9 AM on the 1st of month OR every Monday", not "9 AM on Mondays that are also 1st of month". To avoid confusion, use * in one field. Builder warns about this OR behavior when both fields have non-* values.

How do I create cron for last day of month?

Standard cron can't express "last day of month" directly—different months have different lengths. Workaround: run daily script checking if [[ $(date -d tomorrow +%d) == "01" ]] (if tomorrow is 1st, today is last day). Some enhanced cron (Quartz) supports L symbol for last day. For standard cron, builder can't create this—needs scripting workaround.