Cron Every Day at 4 AM
Schedule a cron job to run every day at 4 AM using 0 4 * * *. Complete field-by-field explanation with scheduling strategies for early morning.
Cron Expression
0 4 * * *
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At 0 |
| Hour | 4 | At 4 |
| Day of Month | * | Every day of the month (1–31) |
| Month | * | Every month (1–12) |
| Day of Week | * | Every day of the week (Sun–Sat) |
Detailed Explanation
The cron expression 0 4 * * * schedules a task to run once per day at exactly 4:00 AM.
Field-by-field breakdown:
0(Minute): At minute 0. The task fires at the top of the hour.4(Hour): At hour 4 (4 AM). The task runs during the pre-dawn hours, typically the lowest usage period for most applications.*(Day of Month): Every day from 1 through 31. No restriction on the day of the month.*(Month): Every month from January through December. No restriction on which month.*(Day of Week): Every day of the week from Sunday through Saturday. No restriction on the day of the week.
This means your task will execute once per day at 4:00 AM server time. The 4 AM time slot is strategic for tasks that should complete before business hours begin. It avoids the congestion at midnight and the DST complications at 2 AM, while still providing a full 4-5 hours before a typical 8-9 AM business start. This makes it suitable for resource-intensive jobs like full database reindexing, large data exports, or comprehensive system scans that may take several hours to complete. Ensure your server's timezone is configured correctly, or use UTC-based scheduling for consistency. This expression is supported by standard cron on Linux/macOS, as well as cloud services like AWS CloudWatch, Google Cloud Scheduler, and GitHub Actions.
Use Case
Perfect for running full-text search index rebuilds on your application database so that fresh indexes are ready before users arrive in the morning.
Try It — Interactive Builder
Every day at 4:00 AM
Next 10 Executions
Ctrl+Shift+C to copy expression