Cron Schedules for Deployments
Automated deployment scheduling is a risk management strategy: by deploying at times when traffic is lowest and when the team is most available to respond to issues, you minimize user impact from any deployment problems that slip past your test suite. An unattended deployment at 2 PM Friday is significantly riskier than a supervised deployment at 10 AM Tuesday — not because the code is different, but because the recovery context is completely different. This collection shows eight deployment scheduling patterns that cover common organizational deployment policies. Nightly staging deploys (0 2 * * 1-5) ensure the staging environment always reflects the latest code from the main branch, keeping QA and integration tests running on fresh code. Monday and Tuesday morning production deploys (0 6 * * 1) give the team the full work week ahead to monitor and respond to any issues that emerge post-deployment. The Wednesday midmorning slot (0 10 * * 3) is a common "change window" in organizations with formal change management processes. Sunday night production deploys (0 22 * * 0) are popular for consumer-facing products because Sunday evening has the lowest user traffic for many North American and European products. The team has Monday morning available to monitor and respond before peak business hours. This is often combined with a feature flag that enables the new functionality Monday morning separately from the code deployment. Mainenance window scheduling: the 0 23 * * 5 expression (Friday at 11 PM) represents a late-night weekend maintenance window, used for infrastructure changes that require brief downtime. These windows are typically announced to users in advance and paired with status page updates. The first of the month at 3 AM (0 3 1 * *) is a common pattern for monthly maintenance that benefits from the quieter post-midnight, post-midnight-rush window. Deployment timing and monitoring coordination: when a deployment job fires, it should automatically suppress non-critical monitoring alerts for the expected deployment duration to prevent false positive pages during the normal brief unavailability of a rolling restart. Re-enable alerts with a configurable delay (typically 5-15 minutes post-deployment) to catch any new issues introduced by the deployment. Canary deployment scheduling: rather than deploying to all servers at once, schedule the cron job to deploy to a percentage of servers (say, 10%) at the initial scheduled time, then automatically expand to 100% after a monitoring delay if no error rate spike is detected. This schedule-driven canary approach provides automatic rollout with built-in validation. Tips: document the deployment schedule in your team's runbook and ensure on-call rotation schedules are aware of when automated deployments occur. Nothing is more confusing than being paged for an alert during a deployment that you didn't know was happening.
0 2 * * 1-5 0 22 * * 0 0 10 * * 2 30 1 * * 3 0 23 * * 5 0 4 * * 0 0 6 * * 1 0 3 1 * *
FAQ
- When is the safest time to schedule production deployments?
- Early morning on weekdays (6–8 AM) or late Sunday night gives you the lowest user traffic while keeping the team available to respond to issues during working hours.
- How do I schedule a weekly deployment on Wednesday?
- Use 0 10 * * 3 to deploy at 10 AM every Wednesday. Day 3 in cron represents Wednesday (0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday).
- Can I run a deployment only on the first of each month?
- Yes. Use 0 3 1 * * to fire at 3 AM on the first day of every month. Be aware that months vary in length, so this gives irregular intervals.
Related Examples
Cron is the Unix job scheduler that has been running scheduled tasks on servers ...
Cron Schedules for Business HoursNot all scheduled jobs should run 24/7. Report generation, Slack digest notifica...
Cron Schedules for Cleanup JobsCleanup jobs are the silent maintainers of production health — they prevent the ...