Copy-paste cron expressions for daily backups, weekly reports, monthly cleanups, and more. Ready-to-use examples with explanations for Unix, Kubernetes, and AWS.
Quick reference for cron expressions
Cron expressions schedule recurring tasks on servers, CI/CD pipelines, and cloud platforms. This guide provides ready-to-use examples you can copy directly into your crontab, Kubernetes CronJob, or scheduling system.
Each example includes the expression, a plain-English explanation, and notes on common variations. Use our Cron Generator tool to customize these patterns for your specific needs.
Understanding cron syntax
Standard cron uses 5 fields: minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-6, Sunday is 0). Special characters include * (any), */n (every n), n-m (range), and n,m (list).
- * * * * * = minute hour day month weekday
- 0 9 * * * = At 9:00 AM every day
- */15 * * * * = Every 15 minutes
- 0 0 1 * * = At midnight on the 1st of each month
Every minute
Running a task every minute is useful for health checks, queue processing, or real-time monitoring.
- * * * * * = Every minute (basic)
- */1 * * * * = Every minute (explicit)
- Use case: Health check pings, queue workers, live monitoring
- Warning: High frequency tasks can overload systems
Every 5, 10, 15, or 30 minutes
Interval-based schedules are common for polling, cache updates, and periodic syncs.
- */5 * * * * = Every 5 minutes
- */10 * * * * = Every 10 minutes
- */15 * * * * = Every 15 minutes (quarter hour)
- */30 * * * * = Every 30 minutes (half hour)
- 0,30 * * * * = At minute 0 and 30 (exact half hours)
Every hour
Hourly tasks are ideal for log rotation, report generation, and data synchronization.
- 0 * * * * = At the start of every hour
- 30 * * * * = At 30 minutes past every hour
- 0 */2 * * * = Every 2 hours (at minute 0)
- 0 */3 * * * = Every 3 hours
- 0 */6 * * * = Every 6 hours (4 times a day)
Daily schedules
Daily cron jobs commonly run backups, cleanup scripts, and daily reports at off-peak hours.
- 0 0 * * * = At midnight every day
- 0 6 * * * = At 6:00 AM every day
- 0 9 * * * = At 9:00 AM every day (business start)
- 0 18 * * * = At 6:00 PM every day (business end)
- 0 2 * * * = At 2:00 AM (common for backups)
- 30 4 * * * = At 4:30 AM (avoid exact hours for load distribution)
Multiple times per day
Schedule tasks at specific times throughout the day using comma-separated hours.
- 0 9,17 * * * = At 9:00 AM and 5:00 PM
- 0 8,12,18 * * * = At 8:00 AM, 12:00 PM, and 6:00 PM
- 0 6,12,18,0 * * * = Every 6 hours at fixed times
- 0 9-17 * * * = Every hour from 9 AM to 5 PM
- */30 9-17 * * * = Every 30 minutes during business hours
Weekly schedules
Weekly tasks are perfect for reports, maintenance windows, and end-of-week processing.
- 0 0 * * 0 = At midnight on Sunday
- 0 0 * * 1 = At midnight on Monday
- 0 9 * * 1 = At 9:00 AM on Monday (weekly meeting reminder)
- 0 18 * * 5 = At 6:00 PM on Friday (weekly report)
- 0 2 * * 6 = At 2:00 AM on Saturday (weekend maintenance)
- 0 0 * * 0,6 = At midnight on Saturday and Sunday
Weekday and weekend schedules
Separate schedules for business days versus weekends using day-of-week ranges.
- 0 9 * * 1-5 = At 9:00 AM Monday through Friday
- 0 0 * * 1-5 = At midnight on weekdays only
- 0 0 * * 6,0 = At midnight on weekends only
- 0 */2 * * 1-5 = Every 2 hours on weekdays
- 0 8-18 * * 1-5 = Every hour 8 AM - 6 PM on weekdays
Monthly schedules
Monthly tasks handle billing cycles, archiving, and monthly reports.
- 0 0 1 * * = At midnight on the 1st of every month
- 0 9 1 * * = At 9:00 AM on the 1st (monthly report)
- 0 0 15 * * = At midnight on the 15th (mid-month)
- 0 0 1,15 * * = At midnight on the 1st and 15th
- 0 2 1 * * = At 2:00 AM on the 1st (monthly backup)
Specific day of month
Target specific days for payroll, billing, or scheduled maintenance.
- 0 0 5 * * = At midnight on the 5th
- 0 0 10 * * = At midnight on the 10th
- 0 0 25 * * = At midnight on the 25th
- 0 9 L * * = At 9:00 AM on the last day of month (where supported)
- 0 0 1-7 * 1 = First Monday of month (1st-7th that is Monday)
Quarterly schedules
Quarterly tasks for financial reports and seasonal processing.
- 0 0 1 1,4,7,10 * = At midnight on 1st of Jan, Apr, Jul, Oct
- 0 9 1 */3 * = At 9:00 AM on 1st every 3 months
- 0 0 1 3,6,9,12 * = End of fiscal quarters
- 0 0 15 1,4,7,10 * = Mid-quarter (15th)
Annual schedules
Yearly tasks for annual reports, license renewals, and year-end processing.
- 0 0 1 1 * = At midnight on January 1st
- 0 9 1 1 * = At 9:00 AM on January 1st (New Year)
- 0 0 31 12 * = At midnight on December 31st
- 0 0 1 7 * = At midnight on July 1st (fiscal year start)
- 0 0 15 4 * = Tax deadline reminder (April 15th)
Database maintenance examples
Common cron expressions for database backup and maintenance tasks.
- 0 2 * * * = Daily database backup at 2:00 AM
- 0 3 * * 0 = Weekly full backup on Sunday at 3:00 AM
- 0 1 * * * = Daily vacuum/optimize at 1:00 AM
- 30 2 * * * = Daily reindex at 2:30 AM
- 0 4 1 * * = Monthly archive old records on the 1st
Log and cleanup examples
Schedule regular cleanup to prevent disk space issues.
- 0 0 * * * = Daily log rotation at midnight
- 0 3 * * * = Daily temp file cleanup at 3:00 AM
- 0 4 * * 0 = Weekly log archival on Sunday
- 0 5 1 * * = Monthly old backup removal
- 0 0 1 1 * = Annual log archive cleanup
Monitoring and alerting examples
Health checks and monitoring tasks need appropriate frequencies.
- * * * * * = Every minute (critical service health check)
- */5 * * * * = Every 5 minutes (standard health check)
- 0 * * * * = Hourly metrics collection
- 0 8,20 * * * = Twice daily status report
- 0 9 * * 1-5 = Daily weekday morning alert summary
CI/CD and deployment examples
Scheduled builds, tests, and deployments for development workflows.
- 0 0 * * * = Nightly build at midnight
- 0 6 * * 1-5 = Pre-work build on weekdays at 6:00 AM
- 0 2 * * 0 = Weekly dependency update on Sunday
- 0 3 * * * = Daily security scan at 3:00 AM
- 0 1 1 * * = Monthly release candidate build
AWS and Kubernetes specifics
Cloud platforms sometimes use different cron formats.
- Kubernetes uses standard 5-field format
- AWS EventBridge uses 6 fields (adds year) and supports ? placeholder
- AWS: cron(0 9 * * ? *) = 9:00 AM daily
- AWS: cron(0 0 1 * ? *) = Midnight on 1st monthly
- GitHub Actions uses 5-field format, always runs in UTC
Timezone considerations
Cron typically runs in the server local timezone. Consider these factors for global systems.
- Document which timezone your cron uses
- Use UTC for globally distributed systems
- Account for daylight saving time transitions
- 2:30 AM jobs may skip or double-run during DST changes
- Kubernetes CronJobs default to controller timezone
Testing your cron expressions
Always validate cron expressions before deploying to production. Use our Cron Generator to see the next run times and verify your schedule is correct. Pay special attention to edge cases like month boundaries and day-of-week conflicts.
FAQ
What is the cron expression for running every day at midnight?
Use 0 0 * * * to run at midnight (00:00) every day. The first 0 is the minute, the second 0 is the hour, and the asterisks mean every day of month, every month, and every day of week.
How do I run a cron job every 5 minutes?
Use */5 * * * * to run every 5 minutes. The */5 in the minute field means every 5th minute. You can use the same pattern for other intervals like */10, */15, or */30.
How do I schedule a cron job only on weekdays?
Use 1-5 in the day-of-week field (the 5th field). For example, 0 9 * * 1-5 runs at 9:00 AM Monday through Friday. Days are numbered 0-6 where 0 is Sunday.
What is the cron expression for the first day of every month?
Use 0 0 1 * * to run at midnight on the 1st of every month. Change the first two numbers to adjust the time, for example 0 9 1 * * for 9:00 AM on the 1st.
Can I run a cron job on the last day of the month?
Standard cron does not support "last day" directly. Some systems support L in the day field (0 0 L * *). Alternatively, use a script that checks if tomorrow is the 1st before running.
How do I run a job at multiple specific times?
Use comma-separated values. For example, 0 9,12,18 * * * runs at 9:00 AM, 12:00 PM, and 6:00 PM daily. You can combine this with ranges: 0 8-17 * * 1-5 runs every hour from 8 AM to 5 PM on weekdays.
What is the difference between day of month and day of week?
Day of month (field 3) specifies dates 1-31. Day of week (field 5) specifies 0-6 (Sunday-Saturday). If both are set to non-asterisk values, the job runs when either condition matches, not both.
How do I avoid cron job overlaps?
For long-running jobs, use a lock file or flock command to prevent overlapping executions. For example: flock -n /tmp/myjob.lock /path/to/script.sh will skip if the previous run is still active.