Cron Every Night at 2 AM

Schedule a cron job to run every night at 2 AM using 0 2 * * *. Includes full field-by-field explanation and best practices for nightly jobs.

Cron Expression

0 2 * * *

Field Breakdown

FieldValueMeaning
Minute0At 0
Hour2At 2
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 2 * * * schedules a task to run once per day at exactly 2:00 AM.

Field-by-field breakdown:

  • 0 (Minute): At minute 0. The task fires at the top of the hour, not at any other minute.
  • 2 (Hour): At hour 2 (2 AM). The task is restricted to the 2 AM hour only, which falls in the early morning low-traffic window.
  • * (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, every day, at 2:00 AM server time. The 2 AM slot is one of the most popular choices for nightly batch jobs because it avoids the midnight rush of day-boundary tasks and falls well within off-peak hours for most businesses. Be mindful of daylight saving time transitions: in many time zones, 2 AM is when clocks spring forward or fall back, which can cause your job to be skipped or run twice. Consider using UTC-based scheduling to avoid this issue. 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

Ideal for nightly database backups that need to run during the lowest-traffic window to minimize impact on production database performance.

Try It — Interactive Builder

Every day at 2:00 AM

**/5*/10*/15*/300
**/2*/3*/6*/120
*1151,15*/2
*11,4,7,101,7
*1-50,615

Next 10 Executions

1.Mon, Apr 27, 2026, 02:00 AM
2.Tue, Apr 28, 2026, 02:00 AM
3.Wed, Apr 29, 2026, 02:00 AM
4.Thu, Apr 30, 2026, 02:00 AM
5.Fri, May 1, 2026, 02:00 AM
6.Sat, May 2, 2026, 02:00 AM
7.Sun, May 3, 2026, 02:00 AM
8.Mon, May 4, 2026, 02:00 AM
9.Tue, May 5, 2026, 02:00 AM
10.Wed, May 6, 2026, 02:00 AM

Ctrl+Shift+C to copy expression

Customize this expression