T
ToolPrime

Cron Expression for Daily at Midnight

Run a cron job once per day at midnight using 0 0 * * *. The standard daily schedule for backups, cleanups, and reporting.

Expression

0 0 * * *

At 00:00 every day

Use Cases

Code Examples

Crontab

# At 00:00 every day
0 0 * * * /path/to/your/script.sh

GitHub Actions

name: Scheduled Job
on:
  schedule:
    - cron: '0 0 * * *'
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "Running Daily at Midnight"

systemd Timer

[Unit]
Description=Daily at Midnight timer

[Timer]
OnCalendar=*-*-* *:*:00
Persistent=true

[Install]
WantedBy=timers.target

Tips

Frequently Asked Questions

Is @daily the same as 0 0 * * *?

Yes, @daily is a shorthand supported by most cron implementations (including crontab and systemd) that is equivalent to 0 0 * * *.

Does midnight mean UTC or local time?

In standard cron, midnight means the server local time. In cloud services like GitHub Actions, you can specify the timezone. Always check your environment.

Related Cron Expressions