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
- • Running heavy database maintenance during off-peak hours
- • Performing full system backups at low-traffic times
- • Rebuilding search indexes overnight
- • Running data warehouse ETL pipelines
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 Tips
- ✓ 3 AM is a common choice to avoid the midnight cron rush
- ✓ Most users are inactive at 3 AM, making it ideal for heavy tasks
- ✓ Be aware of daylight saving time transitions near 2-3 AM
- ✓ Monitor execution time to ensure completion before business hours
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.