⚡
fasttools.me
Run Cron Job Every Day at 2 AM (0 2 * * *)
Nightly Cadence • 2:00 AM System Maintenance

Run Cron Job Every Day at 2 AM (0 2 * * *)

Schedule daily cron jobs at 2:00 AM (0 2 * * *). Visual field breakdown, upcoming run timetable, and production database backup scripts.

Direct Answer Definition

To run a cron job daily at 2:00 AM in Linux, use the expression 0 2 * * *. The 0 specifies minute zero and 2 specifies 2:00 AM in 24-hour military notation, firing once every 24 hours during the deepest off-peak window.

POSIX Cron Expression (5-Field)
Valid Syntax
Natural Language Schedule

At 02:00, every day

Standard Schedule PresetsClick to load

Interactive 5-Field Workbench

Adjust individual cron segments in real time with instant two-way synchronization.

1. Minute0
0 – 59
2. Hour2
0 – 23 (24h)
3. Day of Month*
1 – 31
4. Month*
1 – 12 (Jan – Dec)
Select Month
5. Day of Week*
0 – 6 (Sun – Sat)
Select Day

Next 5 Scheduled Executions

Real-time schedule timetable projected forward from current timestamp.

12026-10-08 20:00:00 UTC
in 10h 57m
22026-10-09 20:00:00 UTC
in 1d 10h
32026-10-10 20:00:00 UTC
in 2d 10h
42026-10-11 20:00:00 UTC
in 3d 10h
52026-10-12 20:00:00 UTC
in 4d 10h

Crontab Command Snippet

Enter your executable command or script path to generate the full crontab configuration line.

Ready to paste in `crontab -e`0 2 * * * curl -fsS https://example.com/cron-job
Runs in system timezone or explicit TZ variablePOSIX Spec
Advertisement
Sponsored Developer Space
Cron Field Syntax Mapping

Field-by-Field Breakdown of `0 2 * * *`

PositionField NameAllowed ValuesValue in `0 2 * * *`Evaluation Meaning
1Minute0 – 5900 (At minute 0)
2Hour0 – 2322 (At 2:00 AM / 02:00)
3Day of Month1 – 31** (Every day of the month: 1-31)
4Month1 – 12** (Every month: 1-12)
5Day of Week0 – 6 (Sun-Sat)** (Every day of the week: 0-6)
Technical Engineering Analysis

The 2 AM Deep Maintenance Standard

2:00 AM (0 2 * * *) is globally recognized as the ideal time for heavy database vacuums, full disk integrity audits, and filesystem backups. For web services hosted in North America and Europe, user traffic reaches its lowest point between 2:00 AM and 4:00 AM local time.

Running heavy jobs at 2:00 AM ensures that any temporary latency spike or database table lock completes long before business users log in at 8:00 AM.

To avoid the DST missing hour bug where spring forward skips 2:00 AM entirely on local timezones, production servers should always operate in UTC.

Real-World Server Implementations

Common Production Scenarios for `0 2 * * *`

Case 01

Full Encrypted Database Dump to R2/S3

Dumps PostgreSQL or MariaDB clusters, encrypts with GPG keys, and streams to geo-redundant S3 cold storage.

pg_dumpall | gpg -e -r [email protected] | aws s3 cp - s3://backups/db-$(date +%F).sql.gpg
Case 02

Operating System Kernel & Security Updates

Runs unattended package upgrades on Ubuntu and Debian instances, patching CVE security flaws without user disruption.

/usr/bin/unattended-upgrade -d
Case 03

Redis Database RDB Snapshot Persistence

Executes BGSAVE on Redis in-memory databases to persist memory states to disk storage safely.

redis-cli bgsave
Operational Traps & Failure Modes

Production Gotchas When Running `0 2 * * *`

  • The DST Spring Forward Bug: If your server uses local US or European time, 2:00 AM is skipped during the spring DST shift! Run servers on UTC.
  • Network Bandwidth Caps: Streaming 50GB database dumps at 2:00 AM can saturate server network interfaces. Throttle bandwidth with pv -L 10M.
  • Lockfile Omission: If a 2 AM backup hangs, the next day's backup at 2 AM could corrupt the archive without flock protection.

Frequently Asked Questions About `0 2 * * *`

Why is 2 AM preferred for database backups?

2:00 AM is the global trough of web application traffic, minimizing the performance impact of database locks and disk I/O spikes.

How do I run a job at 2:30 AM?

Set minute to 30 and hour to 2: 30 2 * * * /path/to/script.sh.

How does DST affect 2 AM cron jobs?

On local-time servers, the spring forward clock jump skips 2:00 AM entirely, causing cron to skip the job. Always set server clocks to UTC (timedatectl set-timezone UTC).

Related Cron Schedule Generators