T
ToolPrime

Cron Expression for Every 10 Minutes During Night Hours

Run a cron job every 10 minutes from midnight to 6 AM using */10 0-6 * * *. Ideal for overnight monitoring and batch processing.

Expression

*/10 0-6 * * *

Every 10 minutes from 00:00 to 06:59

Use Cases

Code Examples

Crontab

# Every 10 minutes from 00:00 to 06:59
*/10 0-6 * * * /path/to/your/script.sh

GitHub Actions

name: Scheduled Job
on:
  schedule:
    - cron: '*/10 0-6 * * *'
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "Running Every 10 Minutes During Night Hours"

systemd Timer

[Unit]
Description=Every 10 Minutes During Night Hours timer

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

[Install]
WantedBy=timers.target

Tips

Frequently Asked Questions

What does 0-6 mean in the hour field?

0-6 is a range covering hours 0 (midnight) through 6 (6 AM). The job runs during the 00:xx, 01:xx, 02:xx, 03:xx, 04:xx, 05:xx, and 06:xx hours.

How do I run every 10 minutes all day except night?

Use */10 7-23 * * * to run every 10 minutes from 7 AM to 11:59 PM, skipping the 0-6 night hours.

Related Cron Expressions