Start free · Free tools · Fair usage limits
Browse Tools

Categories

Custom AI Solutions – AI2Flows
LIVE NEWS
Loading latest AI & SEO news…
Home›Tools›Crontab Builder›How to run a cron job every 2 weeks
Cron expression

How to run a cron job every 2 weeks

How to schedule a cron job every 2 weeks: why one expression isn’t enough, a copy-ready crontab workaround, and next run times.

Quick answer

Standard cron cannot run a job every 2 weeks with one plain expression. Standard cron cannot count weeks, so no single expression runs every 14 days. The usual fix is one crontab line with a short shell check, shown below, which you can copy straight into crontab -e.

Last updated · Maintained by FreeAIToolz · How we test

At 09:00 (9:00 AM) on Monday

Open in the full Crontab Builder →

Copy-ready crontab to run a job every 2 weeks

0 9 * * 1 [ $(( $(date +\%s) / 604800 \% 2 )) -eq 0 ] && /path/to/command

Run weekly, then only continue on even-numbered weeks since the Unix epoch. Use -eq 1 to run on the alternate weeks.

What does 0 9 * * 1 mean?

At 09:00 (9:00 AM) on Monday. This is the base schedule used by the workaround above.

FieldValueAllowedMeaning
Minute00–590
Hour90–239
Day of month*1–31every day of month
Month*1–12every month
Day of week10–6 (0 = Sunday)Monday

Example run times

If the current time were Monday 4 January 2027, 08:58 UTC, 0 9 * * 1 would next run at:

  1. Mon 4 Jan 2027, 09:00 UTC
  2. Mon 11 Jan 2027, 09:00 UTC
  3. Mon 18 Jan 2027, 09:00 UTC
  4. Mon 25 Jan 2027, 09:00 UTC
  5. Mon 1 Feb 2027, 09:00 UTC
  6. Mon 8 Feb 2027, 09:00 UTC

When to use a cron job every 2 weeks

Fortnightly reports, sprint reminders and bi-weekly payroll.

Things to watch out for

Standard cron cannot count weeks, so no single expression runs every 14 days. The expression shown runs every Monday at 9 AM; combine it with a week check.

How to use this schedule in your scheduler

Schedulers below run the base expression 0 9 * * 1. Put the same check (shown in the crontab line) at the start of your job so it exits early on the days it should not run.

Linux crontab

Run crontab -e and add:

0 9 * * 1 [ $(( $(date +\%s) / 604800 \% 2 )) -eq 0 ] && /path/to/command

GitHub Actions

on:
  schedule:
    - cron: '0 9 * * 1'   # UTC

Kubernetes CronJob

apiVersion: batch/v1
kind: CronJob
metadata:
  name: my-job
spec:
  schedule: "0 9 * * 1"
  timeZone: "Etc/UTC"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: job
              image: busybox
              command: ["sh", "-c", "echo run"]

AWS EventBridge Scheduler

EventBridge uses six fields (with a year) and needs ? in either day-of-month or day-of-week:

cron(0 9 ? * MON *)

Spring @Scheduled (seconds first)

@Scheduled(cron = "0 0 9 * * 1", zone = "UTC")

Node.js (node-cron)

cron.schedule('0 9 * * 1', () => { /* job */ }, { timezone: 'UTC' });

Vercel Cron Jobs (vercel.json)

{ "crons": [{ "path": "/api/cron", "schedule": "0 9 * * 1" }] }

Vercel cron jobs run in UTC, and how often they can run depends on your plan.

More cron schedules

Frequently asked questions

Is there a single cron expression for every 2 weeks?
Standard cron cannot count weeks, so no single expression runs every 14 days. The expression shown runs every Monday at 9 AM; combine it with a week check. Run weekly, then only continue on even-numbered weeks since the Unix epoch. Use -eq 1 to run on the alternate weeks.
Which time zone does this cron schedule use?
Cron runs in the time zone of the system or service that executes it. Linux servers and cloud schedulers (GitHub Actions, Vercel, AWS EventBridge by default) normally use UTC. Many crontabs accept CRON_TZ=Area/City at the top, and Kubernetes CronJobs have a timeZone field.
What happens if the server is off at the scheduled time?
Plain cron does not catch up on missed runs. If the machine was off, that run is skipped. Use anacron, or a systemd timer with Persistent=true, if missed jobs must run after boot.
How do I test this schedule before deploying?
Paste the expression into the live checker on this page to see the next 10 run times in UTC and your local time. On Linux, check the system log (grep CRON /var/log/syslog) after the first expected run.