Cron Reference

Cron Every 2 Weeks

Cron expression 0 0 1,15 * * means At 12:00 AM, on the 1st and 15th.

Cron cannot count every other week. 0 0 1,15 * * runs on the 1st and 15th of each month (24 runs a year, not 26); for a true 14-day cycle, run weekly and skip alternate weeks, as shown below.

Cron Expression

0 0 1,15 * *
0Minute
0Hour
1,15Day
*Month
*Weekday

Common use cases

  • Semi-monthly payroll on the 1st and 15th
  • Semi-monthly newsletter delivery
  • Twice-monthly credential rotation or dependency audits

How to use this cron schedule

Standard cron has no every-other-week field. `0 0 1,15 * *` is semi-monthly: it runs on the 1st and 15th, so the gap is 13 to 16 days and there are 24 runs a year instead of 26. That suits semi-monthly payroll, not a bi-weekly one.

For an exact every-two-weeks schedule, run the job weekly and let it skip alternate weeks by week number: `0 0 * * 1 [ $(( $(date +\%s) / 604800 \% 2 )) -eq 0 ] && /path/to/job`. The `%` signs are escaped as `\%` because crontab treats a bare `%` as a newline. Flip `-eq 0` to `-eq 1` to run on the other set of weeks.

Schedulers with their own calendars handle this directly: systemd timers (`OnCalendar` with a start date and `OnUnitActiveSec=2w`), Quartz `CalendarIntervalTrigger`, or a cloud scheduler rate of 14 days.

Want to customize this schedule?

Open it in the visual builder to tweak the expression interactively.

Open in Builder

Need to monitor this cron job?

Cronhub tracks your scheduled jobs and alerts you if they fail or run late.

Monitor with Cronhub

Platform usage examples

Linux / Unix — crontab
# Edit your crontab
crontab -e

# Add this line to run every 2 weeks
0 0 1,15 * * /usr/bin/php /var/www/html/script.php

# Or run a shell script
0 0 1,15 * * /home/user/scripts/job.sh >> /var/log/job.log 2>&1
GitHub Actions
# .github/workflows/scheduled.yml
name: Scheduled Job

on:
  schedule:
    - cron: '0 0 1,15 * *'

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run job
        run: echo "Running every 2 weeks"

Kubernetes CronJob

spec:
  schedule: "0 0 1,15 * *"
  timeZone: "Etc/UTC"

Merge these UTC schedule fields into your CronJob spec on Kubernetes v1.27 or newer. Preview and export with another time zone.

Kubernetes CronJob documentation

systemd timer

[Timer]
OnCalendar=*-*-01,15 00:00:00 UTC

Add these UTC schedule lines to your timer. Export in another time zone.

systemd timer documentation

Related developer tools

More free tools for engineering workflows that pair with scheduled jobs:

Frequently asked questions

What is the cron expression for every 2 weeks?

The cron expression is 0 0 1,15 * *. Cron cannot count every other week. 0 0 1,15 * * runs on the 1st and 15th of each month (24 runs a year, not 26); for a true 14-day cycle, run weekly and skip alternate weeks, as shown below.

How do I schedule a cron job to run every 2 weeks in Linux?

Open your crontab with "crontab -e" and add a new line: 0 0 1,15 * * /path/to/your/script.sh. This schedules your script to run every 2 weeks. Save and exit; the cron daemon picks up the change immediately.

What does the cron expression "0 0 1,15 * *" mean?

Cron cannot count every other week. 0 0 1,15 * * runs on the 1st and 15th of each month (24 runs a year, not 26); for a true 14-day cycle, run weekly and skip alternate weeks, as shown below.

Can I use "0 0 1,15 * *" in GitHub Actions?

Yes. In your workflow YAML, set the schedule trigger: on: schedule: - cron: '0 0 1,15 * *'. GitHub Actions uses standard 5-field Unix cron syntax, so this expression works as-is.

Related cron schedules