Developer

Cron Every Hour, Day & Midnight: All Daily Schedules

Scheduling tasks to run once per hour, daily at midnight, or at specific times during the day is the backbone of server administration and backend development. Master standard daily cron schedules: cron every hour, every day at midnight, twice a day, and custom hourly intervals with copy-paste examples.

Awais 4 min readPublished
Cron Every Hour, Day & Midnight: All Daily Schedules

Scheduling tasks to run once per hour, daily at midnight, or at specific times during the day is the backbone of server administration and backend development. Setting up a cron every hour, every day at midnight, or every 6 hours requires understanding how the 5 standard Unix cron fields interact.

Below is a complete reference of all daily and hourly cron schedule expressions, ready to copy and paste directly into your crontab or task scheduler.

Quick copy-paste daily & hourly cron expressions

  • Every hour on the hour: 0 * * * *
  • Every 2 hours: 0 */2 * * *
  • Every 3 hours: 0 */3 * * *
  • Every 4 hours: 0 */4 * * *
  • Every 6 hours (4 times a day): 0 */6 * * *
  • Every 12 hours (twice a day): 0 */12 * * *
  • Every day at midnight (00:00): 0 0 * * *
  • Every day at 1:00 AM: 0 1 * * *
  • Every day at 6:00 AM: 0 6 * * *
  • Every day at 12:00 PM (Noon): 0 12 * * *
  • Every day at 6:00 PM (18:00): 0 18 * * *
  • Every day at 11:30 PM (23:30): 30 23 * * *
Need to test or generate a custom schedule? Paste any expression into our free Cron Expression Generator to verify exact execution times in your local timezone.

Breaking down: Cron every hour (0 * * * *)

The most common beginner mistake with hourly cron jobs is writing * * * * *. An asterisk in the minute field means "every minute", causing the task to execute 60 times per hour. To run once per hour, you must fix the minute field to a specific number, such as 0 (for the top of the hour) or 15 (at 15 minutes past the hour):

# Runs at 00:00, 01:00, 02:00, ...
0 * * * * /usr/bin/python3 /scripts/hourly-sync.py

# Runs at 00:15, 01:15, 02:15, ...
15 * * * * /usr/bin/python3 /scripts/hourly-cleanup.py

Breaking down: Cron every day at midnight (0 0 * * *)

To run a job once per day at midnight, set both minute and hour to 0. The remaining fields (day of month, month, day of week) remain wildcards (*):

# Minute 0, Hour 0, Every Day, Every Month, Every Day of Week
0 0 * * * /usr/bin/bash /backup/daily-backup.sh

Running jobs twice a day (Specific hours)

To run a script at specific times (e.g., 9:00 AM and 9:00 PM), use a comma-separated list in the hour column:

# Runs at 09:00 and 21:00 every day
0 9,21 * * * /usr/bin/node /app/report.js

Timezone traps in daily cron jobs

Cloud servers (such as Ubuntu on AWS EC2 or DigitalOcean) almost always run in UTC (Coordinated Universal Time). If you configure a backup for 0 0 * * * thinking it will run at your local midnight in New York (EDT, UTC-4), it will actually execute at 8:00 PM local time. Always check your server timezone with the "timedatectl" or "date" command.

Hourly vs nightly — a scheduling instinct

Ask what the job is *for* before choosing an interval. Hourly 0 * * * * suits freshness-driven work: dashboards, sync loops, rate-limited API pulls. Daily 0 0 * * * suits end-of-day consolidation: batch reports, nightly rebuilds, cleanup jobs that should run while the load is light. Midnight is not a magic time — if a nightly job collides with other midnight batch work, 2:00 AM (0 2 * * *) is the industry’s quieter lane.

Daylight saving and the missing hour

Cron time is the server’s local time. In timezones with daylight saving, a job scheduled for 2:30 AM may run twice or not at all on transition days because 2:30 does not exist (or exists twice). For anything that must run exactly on schedule — financial jobs, monitoring — schedule in UTC, which never jumps. Set the server timezone to Etc/UTC and let presentation layers convert for display.

If a “daily at midnight” job must also handle the monthly boundary, prefer the explicit first-of-month expression 0 0 1 * * over date logic inside the script.

Frequently asked questions

The cron expression for every hour on the hour is 0 * * * *. This runs at minute 0 of every hour.

The cron expression for every day at midnight is 0 0 * * *. This runs at 00:00 (12:00 AM) every day.

Use step values: 0 */2 * * * runs every 2 hours on the hour (00:00, 02:00, 04:00, etc.), and 0 */6 * * * runs every 6 hours (00:00, 06:00, 12:00, 18:00).

Cron runs in the server timezone (typically UTC on AWS, DigitalOcean, and GCP). If your local timezone is EST (UTC-5), a 00:00 UTC job fires at 7:00 PM EST. Always verify your server timezone or use CRON_TZ.


Tools mentioned

More reading

View all guides
Free Developer Tools Online: 2026 Developer Toolkit & Guides
Developer

Free Developer Tools Online: 2026 Developer Toolkit & Guides

Explore 30+ free browser-based developer tools: JSON formatters, Base64 converters, cron generators, regex testers, SQL formatters, and hash generators.

3 min readPublished
CSS Border Radius: 15 Copy-Paste Examples
Developer

CSS Border Radius: 15 Copy-Paste Examples

15 modern CSS border radius examples: rounded cards, pills, circle avatars, asymmetrical organic blobs, and fancy 8-value border radius shapes.

3 min readPublished
Percent Encoding Reference Table (Every Character)
Developer

Percent Encoding Reference Table (Every Character)

Complete percent encoding ASCII reference table: quick lookup for spaces, slashes, ampersands, punctuation, and UTF-8 special characters in URLs.

3 min readPublished
URL Encoding Explained: %20 vs +, Reserved Characters & Rules
Developer

URL Encoding Explained: %20 vs +, Reserved Characters & Rules

Complete guide to percent encoding in URLs: learn when to use %20 vs +, how reserved characters like & and ? work, and how to avoid encoding bugs.

3 min readPublished
Cron Expression Cheat Sheet — Copy-Paste Schedule Examples
Developer

Cron Expression Cheat Sheet — Copy-Paste Schedule Examples

Free cron expression cheat sheet with copy-paste examples for every 5 minutes, hourly, daily at midnight, weekdays only, and more.

5 min readPublished
Cron Every 10 Minutes — Syntax, Examples and Best Practices
Developer

Cron Every 10 Minutes — Syntax, Examples and Best Practices

Use the cron expression */10 * * * * to run jobs every 10 minutes, plus examples for common schedules and troubleshooting tips.

3 min readPublished
Why CSV Is Tricky to Parse: Delimiters, Quotes and Headers
Developer

Why CSV Is Tricky to Parse: Delimiters, Quotes and Headers

Why CSV files are harder to read correctly than they look, how to choose the right JSON shape, and the mistakes to avoid.

2 min readPublished
YAML vs JSON: Differences That Matter When Converting
Developer

YAML vs JSON: Differences That Matter When Converting

Why YAML is not just indented JSON, the types the two formats disagree on, and best practices for converting config files.

2 min readPublished