T
ToolPrime

Cron Expression for Every Weekend (Sat-Sun)

Run a cron job every Saturday and Sunday at midnight using 0 0 * * 0,6. Ideal for weekend maintenance and off-peak processing.

Expression

0 0 * * 0,6

At 00:00 on Saturday and Sunday

Use Cases

Code Examples

Crontab

# At 00:00 on Saturday and Sunday
0 0 * * 0,6 /path/to/your/script.sh

GitHub Actions

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

systemd Timer

[Unit]
Description=Every Weekend timer

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

[Install]
WantedBy=timers.target

Tips

Frequently Asked Questions

How do I specify weekends in cron?

Use 0,6 in the day-of-week field where 0 is Sunday and 6 is Saturday. The expression 0 0 * * 0,6 runs at midnight on both Saturday and Sunday.

Can I use SAT,SUN instead of 0,6?

Some cron implementations (like Vixie cron and systemd) support three-letter day names. Check your specific environment for compatibility.

Related Cron Expressions