Back to Blog
Tutorial

15 Cron Job Examples Every Beginner Should Know (2025 Edition)

New to cron? Start here. 15 copy-paste ready cron job examples with explanations. From simple daily tasks to complex schedules—master cron syntax in 10 minutes.

12 min read
By Cron Generator Team

Learning cron syntax feels like decoding hieroglyphics. You see 0 */2 * * * and think "what does that even mean?"

You're not alone. Every developer struggles with cron syntax at first.

This guide gives you 15 practical, copy-paste ready cron examples that cover 90% of real-world scheduling needs. Each example includes the cron syntax, plain English explanation, and what it's commonly used for.

No theory. Just examples you can use today.

Understanding the Basics First

Before diving into examples, here's the cron syntax at a glance:

* * * * * command
│ │ │ │ │
│ │ │ │ └─── Day of week (0-7, Sun=0 or 7)
│ │ │ └───── Month (1-12)
│ │ └─────── Day of month (1-31)
│ └───────── Hour (0-23)
└─────────── Minute (0-59)

Each asterisk (*) means "every":

  • * * * * * = every minute
  • 0 * * * * = every hour (at minute 0)
  • 0 0 * * * = every day (at midnight)

Now let's see this in action.

Example 1: Run Every Minute

* * * * * /usr/local/bin/check-server.sh

Plain English: Every minute, every hour, every day.

Common Uses:

  • Health checks
  • Monitor critical services
  • Check for new files to process
  • Real-time data updates

Warning: This runs 1,440 times per day. Make sure your script is fast and lightweight.

Example 2: Run Every 5 Minutes

*/5 * * * * /usr/local/bin/process-queue.sh

Plain English: Every 5 minutes (at :00, :05, :10, :15, etc.)

Common Uses:

  • Process job queues
  • Check email for new messages
  • Sync data between systems
  • Monitor website uptime

The / Operator: */5 means "every 5th value". Works with any field.

Example 3: Run Every Hour

0 * * * * /usr/local/bin/clear-temp.sh

Plain English: At minute 0 of every hour (1:00, 2:00, 3:00, etc.)

Common Uses:

  • Clear temporary files
  • Refresh cache
  • Hourly reports
  • Check for updates

Why 0 * * * *? The 0 fixes the minute. Everything else is "every" (*).

Example 4: Run Every 2 Hours

0 */2 * * * /usr/local/bin/backup-incremental.sh

Plain English: At minute 0 of every 2nd hour (12:00 AM, 2:00 AM, 4:00 AM, etc.)

Common Uses:

  • Incremental backups
  • Data synchronization
  • Generate reports
  • Clear application cache

Pattern: 0 */N runs every N hours.

Example 5: Run Once Daily at Midnight

0 0 * * * /usr/local/bin/daily-report.sh

Plain English: At 00:00 (midnight) every day.

Common Uses:

  • Daily database backups
  • Generate daily reports
  • Clean up old files
  • Reset daily counters

Pro Tip: Midnight is common, so many jobs compete. Consider 2-4 AM for better performance.

Example 6: Run Once Daily at Specific Time

30 14 * * * /usr/local/bin/afternoon-task.sh

Plain English: Every day at 2:30 PM.

Common Uses:

  • Send scheduled emails
  • Generate business reports
  • Trigger afternoon workflows
  • Scheduled API calls

Reading: 30 14 = minute 30 of hour 14 (2:30 PM in 24-hour format).

Example 7: Run Every Day at Multiple Times

0 6,12,18 * * * /usr/local/bin/tri-daily-check.sh

Plain English: Every day at 6:00 AM, 12:00 PM, and 6:00 PM.

Common Uses:

  • Check systems during business hours
  • Send reminders
  • Three-times-daily backups
  • Monitor services at peak times

The , Operator: Lists specific values. 6,12,18 means "6 OR 12 OR 18".

Example 8: Run Every Weekday (Monday-Friday)

0 9 * * 1-5 /usr/local/bin/weekday-task.sh

Plain English: At 9:00 AM every weekday (Monday through Friday).

Common Uses:

  • Business hours automation
  • Send workday reports
  • Office hours monitoring
  • Weekday-only backups

Day Numbers: 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday, 7=Sunday

The - Operator: Creates ranges. 1-5 = Monday through Friday.

Example 9: Run Every Weekend (Saturday-Sunday)

0 10 * * 6,7 /usr/local/bin/weekend-maintenance.sh

Plain English: At 10:00 AM every Saturday and Sunday.

Common Uses:

  • Weekend maintenance
  • Off-hours backups
  • Low-traffic updates
  • Weekend reports

Alternative: 0 10 * * 0,6 (Sunday=0, Saturday=6)

Example 10: Run First Day of Every Month

0 3 1 * * /usr/local/bin/monthly-report.sh

Plain English: At 3:00 AM on the 1st day of every month.

Common Uses:

  • Monthly billing
  • Generate monthly reports
  • Archive old data
  • Reset monthly quotas

Pattern: 0 3 1 * * = minute 0, hour 3, day 1, any month, any day-of-week.

Example 11: Run Last Day of Every Month

This is tricky because months have different lengths. Solution: Run on the 1st and process previous month's data.

0 2 1 * * /usr/local/bin/last-month-report.sh

Plain English: At 2:00 AM on the 1st (processes previous month).

Why This Works: Easier than calculating last day of each month.

Alternative (if you must run on last day):

0 2 28-31 * * [ "$(date +\%d -d tomorrow)" = "01" ] && /usr/local/bin/month-end.sh

Example 12: Run Every Quarter (Jan, Apr, Jul, Oct)

0 4 1 1,4,7,10 * /usr/local/bin/quarterly-report.sh

Plain English: At 4:00 AM on the 1st day of January, April, July, and October.

Common Uses:

  • Quarterly financial reports
  • Quarterly backups
  • Seasonal tasks
  • Compliance reports

Pattern: 1,4,7,10 lists the month numbers.

Example 13: Run Every 30 Minutes

*/30 * * * * /usr/local/bin/half-hour-check.sh

Plain English: At minute 0 and 30 of every hour.

Common Uses:

  • Frequent monitoring
  • API polling
  • Data sync
  • Queue processing

Alternative (more explicit):

0,30 * * * * /usr/local/bin/half-hour-check.sh

Example 14: Run Monday Morning at 8 AM

0 8 * * 1 /usr/local/bin/monday-morning.sh

Plain English: Every Monday at 8:00 AM.

Common Uses:

  • Weekly reports
  • Monday reminders
  • Start-of-week tasks
  • Weekly backups

Day 1 = Monday in the cron day-of-week field.

Example 15: Run During Business Hours Only

0 9-17 * * 1-5 /usr/local/bin/business-hours.sh

Plain English: Every hour from 9:00 AM to 5:00 PM, Monday through Friday.

Common Uses:

  • Office hours monitoring
  • Business-hours-only processing
  • Limit API calls to working hours
  • Daytime-only notifications

Runs: 9 times per weekday (9 AM, 10 AM, ..., 5 PM) = 45 times per week.

Common Patterns Summary

| Pattern | Cron Expression | When It Runs | |---------|----------------|--------------| | Every minute | * * * * * | 1,440 times/day | | Every 5 minutes | */5 * * * * | 288 times/day | | Every 15 minutes | */15 * * * * | 96 times/day | | Every hour | 0 * * * * | 24 times/day | | Every 2 hours | 0 */2 * * * | 12 times/day | | Every 6 hours | 0 */6 * * * | 4 times/day | | Daily at midnight | 0 0 * * * | Once/day | | Daily at 3 AM | 0 3 * * * | Once/day | | Twice daily | 0 6,18 * * * | 2 times/day | | Weekdays only | 0 9 * * 1-5 | 5 times/week | | Weekends only | 0 10 * * 6,7 | 2 times/week | | Weekly (Sunday) | 0 2 * * 0 | Once/week | | Monthly (1st) | 0 3 1 * * | Once/month | | Yearly (Jan 1) | 0 4 1 1 * | Once/year |

Operators Quick Reference

| Operator | Meaning | Example | Result | |----------|---------|---------|--------| | * | Every/any | * * * * * | Every minute | | */N | Every Nth | */5 * * * * | Every 5 minutes | | , | List | 0 1,13 * * * | 1 AM and 1 PM | | - | Range | 0 9-17 * * * | 9 AM through 5 PM | | Combined | Mix all | */10 9-17 * * 1-5 | Every 10 min, 9-5, weekdays |

Testing Your Cron Jobs

Before deploying to production:

1. Validate the syntax: Use our Cron Expression Generator to verify your expression does what you think.

2. Test with frequent execution first:

# Instead of daily at 2 AM
0 2 * * * /usr/local/bin/backup.sh

# Start with every minute for testing
* * * * * /usr/local/bin/backup.sh

# Verify it works, then change to daily

3. Add logging:

* * * * * /usr/local/bin/script.sh >> /var/log/cron-test.log 2>&1

4. Check the logs:

tail -f /var/log/cron-test.log

Next Steps

You now have 15 working cron examples. Here's what to do next:

  1. Pick one that fits your need (copy the syntax)
  2. Modify the command (your script path)
  3. Add it to crontab (crontab -e)
  4. Add logging (append >> /var/log/yourjob.log 2>&1)
  5. Test with frequent execution (every minute first)
  6. Change to actual schedule once verified

Pro tip: Use our Cron Expression Generator to:

  • Build expressions visually
  • See exactly when jobs will run
  • Validate syntax before deploying
  • Copy perfect expressions

Ready to build your custom schedule? Try the generator now!


Related Articles

Learn More About Cron:

Practical Examples:

Advanced Topics:


Keywords: cron job examples, cron syntax examples, crontab examples, cron schedule examples, linux cron examples, cron expression examples, cron job tutorial, learn cron