Every X Hours Cron Expressions

Master hourly cron scheduling with expressions for every 1 to 23 hours. Perfect for regular maintenance, data processing, and automated reporting tasks.

Popular Hourly Schedules

Every 1 hour

0 */1 * * *

Runs every hour at the start of the hour

Common uses:

  • Log rotation
  • Data aggregation
  • Cache refresh
  • Hourly reports

Best practices:

  • Consider using minute offset to avoid peak load
  • Monitor for overlapping executions

Every 2 hours

0 */2 * * *

Runs every 2 hours for moderate frequency tasks

Common uses:

  • Database backups
  • Analytics processing
  • Feed updates
  • System maintenance

Best practices:

  • Good balance between frequency and resource usage

Every 3 hours

0 */3 * * *

Runs every 3 hours - eight times per day

Common uses:

  • Data synchronization
  • Report generation
  • Batch processing
  • Health checks

Best practices:

  • Aligns well with 24-hour cycle

Every 4 hours

0 */4 * * *

Runs every 4 hours - six times per day

Common uses:

  • Major backups
  • Data warehouse updates
  • System scans
  • Index rebuilding

Best practices:

  • Good for resource-intensive tasks

Every 6 hours

0 */6 * * *

Runs every 6 hours - four times per day

Common uses:

  • Quarter-day reports
  • Large data sync
  • Comprehensive backups
  • System updates

Best practices:

  • Ideal for dividing day into quarters

Every 8 hours

0 */8 * * *

Runs every 8 hours - three times per day

Common uses:

  • Shift-based processing
  • Major maintenance
  • Full system backups
  • Data migrations

Best practices:

  • Aligns with 8-hour work shifts

Every 12 hours

0 */12 * * *

Runs twice daily - every 12 hours

Common uses:

  • Daily summaries
  • Major sync operations
  • Comprehensive reports
  • System snapshots

Best practices:

  • Common for AM/PM processing

All Hourly Intervals (1-23 Hours)

Every 1h
0 */1 * * *
Every 2h
0 */2 * * *
Every 3h
0 */3 * * *
Every 4h
0 */4 * * *
Every 5h
0 */5 * * *
Every 6h
0 */6 * * *
Every 7h
0 */7 * * *
Every 8h
0 */8 * * *
Every 9h
0 */9 * * *
Every 10h
0 */10 * * *
Every 11h
0 */11 * * *
Every 12h
0 */12 * * *
Every 13h
0 */13 * * *
Every 14h
0 */14 * * *
Every 15h
0 */15 * * *
Every 16h
0 */16 * * *
Every 17h
0 */17 * * *
Every 18h
0 */18 * * *
Every 19h
0 */19 * * *
Every 20h
0 */20 * * *
Every 21h
0 */21 * * *
Every 22h
0 */22 * * *
Every 23h
0 */23 * * *

Advanced Hourly Patterns

Offset Hour Schedules

Run at specific minutes past the hour to avoid peak loads:

15 * * * * - Every hour at 15 minutes past
30 */2 * * * - Every 2 hours at 30 minutes past
45 */3 * * * - Every 3 hours at 45 minutes past

Business Hours Only

Restrict hourly jobs to business hours:

0 9-17 * * 1-5 - Every hour 9am-5pm weekdays
0 8-18/2 * * 1-5 - Every 2 hours 8am-6pm weekdays
0 6-22/4 * * * - Every 4 hours 6am-10pm daily

Time Zone Considerations

Important notes for hourly schedules:

  • Cron uses the system's local time zone by default
  • Consider DST changes for critical hourly jobs
  • Use UTC for globally distributed systems
  • Document time zone assumptions in your crontab

Industry-Specific Examples

E-Commerce & Retail

Inventory sync0 */2 * * *
Price updates0 */6 * * *
Sales reports0 */4 * * *

DevOps & Infrastructure

Metrics collection0 * * * *
Log rotation0 */3 * * *
Backup snapshots0 */8 * * *

Data & Analytics

ETL pipeline0 */4 * * *
Dashboard refresh0 * * * *
ML model training0 */12 * * *

Finance & Banking

Transaction reconciliation0 */2 * * *
Risk assessment0 */6 * * *
Compliance reports0 */8 * * *

Performance & Optimization Tips

Resource Management

  • Stagger job start times using minute offsets
  • Implement job queuing for resource-intensive tasks
  • Use locks to prevent overlapping executions
  • Monitor CPU and memory usage patterns

Reliability Best Practices

  • Add error handling and retry logic
  • Log execution times and outcomes
  • Set up monitoring and alerting
  • Test thoroughly before production deployment