T
ToolPrime

Cron Expression for Every Day at 3 AM

Run a cron job daily at 3:00 AM using 0 3 * * *. A popular off-peak time for heavy maintenance tasks that should not affect users.

Expression

0 3 * * *

At 03:00 every day

Use Cases

Code Examples

Crontab

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

GitHub Actions

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

systemd Timer

[Unit]
Description=Every Day at 3 AM timer

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

[Install]
WantedBy=timers.target

node-cron (Node.js)

import cron from 'node-cron'

// At 03:00 every day
cron.schedule('0 3 * * *', () => {
  console.log('Running Every Day at 3 AM')
})

Spring (@Scheduled, Java)

// At 03:00 every day
@Scheduled(cron = "0 0 3 * * *")
public void run() {
    // your task
}

Spring cron has 6 fields (a leading seconds field), so a 0 is prepended to the standard 5-field expression.

Tips

Frequently Asked Questions

Why is 3 AM better than midnight for cron jobs?

Midnight (0 0 * * *) is the default time for many cron jobs, causing resource contention. Running at 3 AM avoids this "thundering herd" effect and gives tasks more headroom.

Are there daylight saving time issues at 3 AM?

In some time zones, 2 AM clocks jump to 3 AM (spring forward) or 2 AM repeats (fall back). Jobs scheduled between 2-3 AM may skip or run twice. Use UTC to avoid this.

Related Cron Expressions

Related Tools