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.Fri, Mar 13, 2026, 02:00 AM
2.Sat, Mar 14, 2026, 02:00 AM
3.Sun, Mar 15, 2026, 02:00 AM
4.Mon, Mar 16, 2026, 02:00 AM
5.Tue, Mar 17, 2026, 02:00 AM
6.Wed, Mar 18, 2026, 02:00 AM
7.Thu, Mar 19, 2026, 02:00 AM
8.Fri, Mar 20, 2026, 02:00 AM
9.Sat, Mar 21, 2026, 02:00 AM
10.Sun, Mar 22, 2026, 02:00 AM

Ctrl+Shift+C to copy expression

Customize this expression