Complex Cron Patterns - Advanced Scheduling

Combine multiple cron fields for precise scheduling. Master business hours, multi-schedule patterns, and advanced field combinations to build exactly the schedule you need.

Try Any Complex Pattern

Free Cron Job Generator & Editor

The easiest way to edit, visualize, and understand cron schedules. Create, test, and export cron expressions with our intuitive online tool.

Quick Reference

Cron Format

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

Special Characters

* = any value
, = value list separator
- = range of values
/ = step values

Common Examples

0 0 * * *
Daily at midnight
0 12 * * *
Daily at noon
0 0 * * 0
Weekly on Sunday
0 0 1 * *
Monthly on 1st
*/15 * * * *
Every 15 minutes
0 9-17 * * 1-5
Business hours
Loading presets...

Frequently Asked Questions

Get answers to common questions about cron jobs, scheduling, and using our cron expression generator.

A cron job is a scheduled task that runs automatically at specified times on Unix-like systems. Cron jobs use cron expressions (like "0 9 * * 1-5") to define when they should execute, making them perfect for automation, backups, and recurring tasks.
Cron expressions have 5 fields: minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7). For example, "30 14 * * 1-5" means run at 2:30 PM on weekdays. Use our generator to see exactly when your cron will run.
Standard cron jobs can run as frequently as once per minute. For more frequent execution, you need extended cron formats or specialized schedulers. Our tool supports both standard 5-field and extended 6-field cron expressions.
Cron jobs typically run in the server's local timezone. Some systems support timezone-specific cron formats. Our tool lets you preview execution times in different timezones to help you schedule jobs correctly.
Popular examples include: "0 0 * * *" (daily at midnight), "*/15 * * * *" (every 15 minutes), "0 9 * * 1-5" (weekdays at 9 AM), and "0 0 1 * *" (first day of each month). Browse our 316+ presets for more examples.
Common issues include: incorrect cron syntax, missing file permissions, wrong file paths, minimal environment variables, or cron daemon not running. Use our validator to check your syntax and see the human-readable description of your schedule.

Need more help? Check out our comprehensive guides:

Learn More About Cron

Master cron jobs and scheduling with our comprehensive guides and tutorials. From basics to advanced techniques.

systemd Timers vs Cron: Which Scheduler Should You Use?

Compare systemd timers with cron: reliability, logging, dependencies, calendar syntax, and migration tips.

Kubernetes CronJobs: Complete Scheduling Guide

Spec, concurrency policies, timezones, retries, and best practices for scheduling with Kubernetes CronJobs.

Cron Every X Minutes: Expressions and Examples

Copy-ready cron expressions for */2, */5, */10, */15, */30 with explanations and tips to avoid pitfalls.

What is a Cron Job?

A beginner-friendly introduction to the concept of cron, what it is, and why it's a powerful tool for automation.

How to Write Cron Expressions: Complete Guide with Examples

Master cron expression syntax with our comprehensive guide covering the 5-field format, common patterns, examples, and best practices.

Understanding Cron Syntax: A Complete Guide

A detailed breakdown of the cron syntax, including special characters, keywords, and practical examples.

Common Cron Job Examples

A list of practical, real-world cron job examples you can use in your projects.

Troubleshooting Cron Jobs: Complete Debugging Guide

Fix cron jobs that won't run with our comprehensive troubleshooting guide. Debug common issues, check logs, fix permissions, and resolve environment problems.

Cron Best Practices

Learn how to write, manage, and debug cron jobs effectively and safely.

Cron Job Alternatives: Complete Guide to Modern Task Scheduling

Discover modern alternatives to traditional cron jobs including systemd timers, cloud schedulers, container orchestration, and workflow engines.

Cron Jobs for DevOps: Complete Infrastructure Automation Guide

Master DevOps automation with cron jobs. Comprehensive guide covering monitoring, backups, log management, security scanning, and enterprise infrastructure automation.

Docker Cron Jobs: Complete Container Scheduling Guide

Master container scheduling with Docker cron jobs, Docker Compose automation, Kubernetes CronJobs, and production-ready container management strategies.

Database Maintenance with Cron: Complete Automation Guide

Master database automation with cron jobs. Comprehensive guide covering automated backups, cleanup, optimization, monitoring, and disaster recovery for MySQL, PostgreSQL, MongoDB, and more.

Data Science & Analytics Cron Jobs: Complete Automation Guide

Comprehensive guide to automating data science workflows with cron jobs - from ML pipelines to report generation.

Security Automation with Cron Jobs: Complete Guide

Master security automation with cron jobs. Comprehensive guide covering vulnerability scanning, log analysis, compliance monitoring, and threat detection.

Popular Complex Patterns

Standard 9-5 weekdays

0 9-17 * * 1-5

Every hour during business hours (9 AM - 5 PM, Mon-Fri)

Common uses:

  • Business monitoring
  • Hourly reports
  • Customer support checks
  • Sales tracking

Every 15 min during business hours

*/15 9-17 * * 1-5

Every 15 minutes during business hours

Common uses:

  • Real-time dashboards
  • Queue monitoring
  • SLA tracking
  • Active monitoring

Extended hours 8-20

0 8-20 * * 1-5

Extended business hours (8 AM - 8 PM, weekdays)

Common uses:

  • Extended support
  • Global team coverage
  • Long operations

Night shift

0 22-6 * * *

Night shift hours (10 PM - 6 AM)

Common uses:

  • Overnight processing
  • Night maintenance
  • Batch jobs
  • Low-traffic operations

Twice daily

0 0,12 * * *

Twice daily (midnight and noon)

Common uses:

  • AM/PM reports
  • Data sync
  • Backup snapshots
  • Status updates

Three times daily

0 8,13,18 * * *

Three times daily (8 AM, 1 PM, 6 PM)

Common uses:

  • Shift change reports
  • Regular updates
  • Data validation
  • Status checks

First Monday

0 9 1-7 * 1

First Monday of every month at 9 AM

Common uses:

  • Monthly team meetings
  • Sprint planning
  • Monthly reviews
  • Budget review

Weekend maintenance

0 2-6 * * 0,6

Weekend maintenance window (2-6 AM, Sat/Sun)

Common uses:

  • Infrastructure updates
  • Database maintenance
  • System upgrades
  • Full backups

Peak hours only

*/10 10-14 * * 1-5

Every 10 min during peak hours (10 AM - 2 PM)

Common uses:

  • Peak traffic monitoring
  • Load balancing
  • Performance tracking

Business Hours Reference

Standard 9-5 weekdays
0 9-17 * * 1-5
Every 15 min during business hours
*/15 9-17 * * 1-5
Every 30 min during business hours
*/30 9-17 * * 1-5
Extended hours 8-20
0 8-20 * * 1-5
Night shift
0 22-6 * * *

Multi-Schedule Reference

Twice daily
0 0,12 * * *
Three times daily
0 8,13,18 * * *
Four times daily
0 0,6,12,18 * * *
At specific minutes
0,30 * * * *
Work hours every 2h
0 9,11,13,15,17 * * 1-5
Weekday mornings
0 6,7,8 * * 1-5
Weekend maintenance
0 2-6 * * 0,6

Advanced Pattern Techniques

Combining Hour Ranges with Day-of-Week

Use ranges and lists across multiple fields to create precise schedules:

0 9-17 * * 1-5 - Hour range 9-17 restricts to 9 AM through 5 PM; day-of-week range 1-5 restricts to Monday through Friday
*/15 8-18 * * 1-5 - Step value */15 in the minute field combined with hour range creates high-frequency business-hours monitoring
0 8-18/2 * * 1-5 - Step value /2 within hour range 8-18 runs at 8, 10, 12, 14, 16, 18

First/Last Day-of-Week in a Month

Standard cron has no built-in "first Monday" or "last Friday" syntax, but you can approximate it:

0 9 1-7 * 1 - First Monday: day-of-month 1-7 combined with day-of-week 1 (Monday) ensures it only runs on the Monday that falls in the first 7 days
0 17 25-31 * 5 - Last Friday (approx): day-of-month 25-31 combined with day-of-week 5 (Friday) catches the last Friday in most months
Note: The day-of-month and day-of-week fields in standard cron are OR-ed together in some implementations. Verify behavior with your specific cron daemon.

Avoiding Overlapping Executions

Complex patterns with high frequency can trigger overlapping runs. Protect against this:

  • Use file-based locks (e.g., flock) to prevent concurrent execution of the same job
  • Check for a running PID before starting a new instance
  • Set execution timeouts shorter than the interval between runs
  • Log start/end times to detect jobs that routinely overlap with the next scheduled run

Industry-Specific Examples

SaaS & Web Apps

Business hours monitoring*/15 9-17 * * 1-5
Peak traffic handling*/10 10-14 * * 1-5
Multi-timezone support0 0,8,16 * * *
Maintenance windows0 2-6 * * 0,6

Healthcare

Shift-based processing0 7,15,23 * * *
Medication reminders0 8,13,18 * * *
Report generation0 6,14,22 * * *
Compliance monitoring0 9-17 * * 1-5

Financial Services

Market hours monitoring*/5 9-16 * * 1-5
Pre/post-market processing0 6,7,8,17,18 * * 1-5
Multi-timezone reporting0 0,8,16 * * 1-5
End-of-day reconciliation0 17 * * 1-5

Education

Class schedule processing0 8-15 * * 1-5
Semester boundaries0 9 1-7 1,6,9 1
Academic calendar0 9 1 * *
Grading periods0 17 25-31 * 5