Cron · Daily · Midnight · @daily
Cron Job Every Day at Midnight
Updated: May 2026
Nightly maintenance — backups, cleanup, report generation — usually runs once a day at midnight. The expression is 0 0 * * *, and cron also accepts the nicknames @daily and @midnight.
See the next run times instantly · No upload
The expression
0 0 * * * /path/to/command
@daily /path/to/command
Read it field by field: minute 0, hour 0, any day of the month, any month, any day of the week. That is exactly 00:00 every day. The first 0 is the minute and the second 0 is the hour — getting that order wrong is the most common beginner error.
Run daily at another time
To shift the daily run, change the hour (and optionally the minute):
0 3 * * *— every day at 3:00am.30 6 * * *— every day at 6:30am.0 22 * * *— every day at 10:00pm.15 2 * * 1-5— at 2:15am on weekdays only.
Why midnight can be risky
Midnight is the default for countless jobs, so 00:00 tends to be the busiest moment on a server — every cron task firing at once. On top of that, daylight-saving transitions can make the midnight hour repeat or be skipped, which means a strictly-midnight job may run twice or not at all on those two nights a year.
For these reasons, experienced operators often pick an off-peak, DST-safe time such as 30 2 * * * (2:30am). It avoids the crowd at midnight and sidesteps the ambiguous hour around the spring and autumn clock changes.
Confirm before you deploy
Paste your daily expression into the generator. It translates the line to plain English and lists the next several run dates in your local time zone, so you can be certain the job fires at the time you intended — not twelve hours off because the minute and hour were swapped.
Frequently asked questions
Is @daily the same as @midnight?
Yes. Both expand to 0 0 * * * on standard cron implementations.
How do I run on the first of each month at midnight?
Use 0 0 1 * *. Adding 1 to the day-of-month field limits it to the 1st.
What time zone does midnight use?
The server's local time zone. If your machine runs in UTC, midnight means 00:00 UTC, which may be a different local time for you.