{
  "id": 1200508,
  "title": "\"Cron 'every 2 weeks' doesn't exist. Here's the expression that actually works.\"",
  "url": "https://urgent.news/2026/08/16/cron-every-2-weeks-doesnt-exist-heres-the-expression-that-actually",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-16T04:35:37.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/developer_tech/cron-every-2-weeks-doesnt-exist-heres-the-expression-that-actually-works-2n5"
  },
  "original_language": "en",
  "account": "You have been searching for \"cron every 2 weeks\" because your maintenance job runs weekly, and the official documentation does not address this specific requirement. This is not your fault—the five-field format of cron does not account for week parity. There is no option to write */2w or every-other. However, there is a day-of-month workaround that provides a genuine biweekly cadence, and it is not what most people write. The common mistake is to write 0 0 * * 1 (every Monday) and assume it means every other Monday. This does not work, as the expression fires every single Monday, every week, which is precisely what you were trying to avoid. The correct expression is: 0 0 1-7,15-21 * 1. Every 2 weeks on Monday at midnight. Monday occurs on day-of-month 1-7 in one week of the month and 15-21 in the next, so it runs exactly once per fortnight. The same technique can be applied to other weekdays: 0 0 1-7,15-21 * 5 for every 2 weeks on Friday (payroll, reports), 0 9 8-14,22-28 * 3 for every 2 weeks on Wednesday at 9 AM, and 30 4 1-7,15-21 * 0 for every 2 weeks on Sunday at 4:30 AM. There are pitfalls to avoid, such as windows that end near day 28, as they disappear in months with fewer days. It is preferable to use windows that never cross into the next month. If you want biweekly runs on a specific date like the 1st, this cannot be expressed within cron alone, as no day-of-month value represents every other month. A cleaner alternative would be to keep a weekly line (0 0 * * 1) as the trigger and use a small wrapper script to track a timestamp, skipping every other run. This approach is simpler, more readable, and does not break in February. Application schedulers like APScheduler or croniter handle biweekly scheduling through simple calendar arithmetic without the need for day-of-month tricks. I've compiled a comprehensive reference of verified biweekly expressions, including this guide, at https://cron-generator-kappa.vercel.app/guides/cron-every-two-weeks. Bookmark it to avoid reconstructing the windows from memory again. If your cron never seems to fire, the issue might be a timezone problem rather than the schedule itself. While cron's five fields cannot natively handle every 2 weeks, the day-of-month window is the workaround, and now you have the expressions to copy. What biweekly jobs do you run? Every-other-Monday reports, or something else? I would be interested to hear what people are scheduling. The answers often reveal cleaner patterns than my day-of-month trick.",
  "summary": "You just Googled \"cron every 2 weeks\" because your clean-up job keeps running weekly, and the cron docs are silent on the whole idea. That's not your fault — the 5-field format has no concept of week parity. There's no */2w , no every-other . But there's a day-of-month trick that gives you a real biweekly cadence, and it's not what most people write. The trap most people fall into. Writing 0 0 *…",
  "key_points": [
    "Correct cron expression for biweekly Monday runs: 0 0 1-7,15-21  1",
    "Alternative to day-of-month trick: use weekly trigger with wrapper script to skip every other run"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}