T
ToolPrime

Cron Expression for Every 6 Hours

Run a cron job every 6 hours using 0 */6 * * *. Runs 4 times a day, ideal for periodic syncs and batch processing.

Expression

0 */6 * * *

Every 6 hours at minute 0

Use Cases

Code Examples

Crontab

# Every 6 hours at minute 0
0 */6 * * * /path/to/your/script.sh

GitHub Actions

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

systemd Timer

[Unit]
Description=Every 6 Hours timer

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

[Install]
WantedBy=timers.target

Tips

Frequently Asked Questions

What times does every 6 hours run?

With 0 */6 * * *, the job runs at midnight, 6 AM, noon, and 6 PM (server time).

Can I run at 3 AM, 9 AM, 3 PM, 9 PM instead?

Yes, use 0 3,9,15,21 * * * or equivalently 0 3-23/6 * * * to offset the 6-hour cycle to start at 3 AM.

Related Cron Expressions