Skip to content

Cron Expression Patterns

This guide covers common cron expression patterns, tips for choosing the right schedule, and pitfalls to avoid.

Common patterns

High-frequency monitoring

ExpressionScheduleUse case
* * * * *Every minuteCritical health checks, uptime monitoring
*/2 * * * *Every 2 minutesNear-real-time status polling
*/5 * * * *Every 5 minutesStandard health checks
*/15 * * * *Every 15 minutesPeriodic data freshness checks
*/30 * * * *Every 30 minutesSemi-frequent syncs

Standard schedules

ExpressionScheduleUse case
0 * * * *Every hour (at :00)Hourly aggregation, cache refresh
0 */2 * * *Every 2 hoursPeriodic batch processing
0 */6 * * *Every 6 hoursQuarterly reports, data syncs
0 */12 * * *Every 12 hoursTwice-daily maintenance

Daily schedules

ExpressionScheduleUse case
0 0 * * *Daily at midnightNightly cleanup, log rotation
0 2 * * *Daily at 2 AMOff-peak data processing
0 9 * * *Daily at 9 AMMorning reports, notifications
30 8 * * 1-5Weekdays at 8:30 AMBusiness-hours only tasks

Weekly and monthly

ExpressionScheduleUse case
0 0 * * 1Every Monday at midnightWeekly reports
0 9 * * 5Every Friday at 9 AMEnd-of-week summaries
0 0 1 * *First of the month at midnightMonthly billing, reports
0 0 15 * *15th of the month at midnightMid-month checks

Staggering schedules

If you have multiple crons that run at the same interval, stagger their start times to avoid thundering-herd effects on your endpoints:

# Instead of all at :00
0 * * * * # Cron A — every hour at :00
5 * * * * # Cron B — every hour at :05
10 * * * * # Cron C — every hour at :10

For daily crons, spread them across the early morning hours instead of all at midnight:

0 0 * * * # Job A — midnight
0 1 * * * # Job B — 1 AM
0 2 * * * # Job C — 2 AM

Timezone considerations

Cron expressions are evaluated in UTC. If your business logic depends on local time zones, convert your desired local time to UTC:

Local time (US Eastern, UTC-5)UTC equivalentCron expression
9 AM ET2 PM UTC0 14 * * *
Midnight ET5 AM UTC0 5 * * *
5 PM ET10 PM UTC0 22 * * *

Pitfalls to avoid

Running too frequently

Every-minute crons (* * * * *) consume your monthly request quota quickly. A cron firing every minute uses 43,200 requests per month. Use 5-minute intervals (*/5 * * * *) unless you genuinely need per-minute resolution.

Long-running endpoints with short intervals

If your endpoint takes 90 seconds to respond but the cron fires every minute, you will have overlapping executions. Each execution is independent — Recuro does not wait for the previous one to finish. Set your interval longer than your expected response time, or set a shorter timeout_seconds and fix the slow endpoint.

Forgetting about DST

Because cron expressions use UTC, daylight saving time shifts will affect the local-time equivalent of your schedule. A cron at 0 14 * * * (UTC) is 9 AM Eastern Standard Time but 10 AM Eastern Daylight Time. If exact local time matters, adjust your cron expression seasonally or schedule at a time that is acceptable in both offsets.

Next steps