# Quarterly Cron Schedules: Calendar Quarter Starts vs Fiscal Quarter-End Closes

> Avoid off-by-one month bugs in */3 quarterly cron expressions, align custom fiscal quarters (Feb/May/Aug/Nov), and handle uneven 30/31-day quarter-end closes.

- **Canonical URL**: https://opslint.dev/cron/quarterly-and-fiscal-year-boundary-schedules/
- **Category**: `CRON`
- **Interactive Workbench**: [Open in Live Workbench](https://opslint.dev/cron/#expr=5%200%201%201%2C4%2C7%2C10%20*&tz=UTC)
- **Normative Specifications**: `POSIX.1-2017 crontab Month Field (1-12 Step Expansion)`, `systemd.time(7) quarterly Shorthand (01,04,07,10-01 00:00:00)`

## Incident Symptom & Root Cause

**Production Symptom**: An engineer writes 0 0 31 3,6,9,12 * for quarter-end financial reporting and completely misses Q2 (June 30) and Q3 (September 30)! Or a SaaS company on a February 1 fiscal year writes */3 expecting May/Aug/Nov/Feb and triggers on Jan/Apr/Jul/Oct instead.

**Protocol / Engine Root Cause**: In the Month field (1–12), */3 starts from the field minimum (1 = January), expanding strictly to 1,4,7,10 (calendar quarter starts, NOT quarter ends 3,6,9,12, and NOT custom fiscal quarters like 2,5,8,11). Meanwhile, quarter-end months alternate between 31 days (March 31, December 31) and 30 days (June 30, September 30).

## Remediation Diff (Broken vs Verified Fix)

### Broken Quarter-End & Fiscal-Quarter Cron Rules

```text
# BUG 1: Skips Q2 (June has 30 days) and Q3 (September has 30 days)!
55 23 31 3,6,9,12 * /opt/finance/quarter-close.sh

# BUG 2: */3 expands to Jan, Apr, Jul, Oct (1,4,7,10), NOT Mar, Jun, Sep, Dec!
0 0 1 */3 * /opt/finance/q-end-summary.sh
```

### Explicit Month Lists for Quarter-Start & Quarter-End Closes

```text
# Pattern A (Recommended): Run 5 minutes into Day 1 of the new quarter (Q1..Q4 closed!)
# Explicit 1,4,7,10 is clearer and safer than */3:
5 0 1 1,4,7,10 * /opt/finance/close-previous-quarter.sh

# Pattern B: Exact 23:55 on last calendar day of Q1(Mar 31), Q2(Jun 30), Q3(Sep 30), Q4(Dec 31):
55 23 31 3,12 * /opt/finance/quarter-snapshot.sh
55 23 30 6,9  * /opt/finance/quarter-snapshot.sh

# Pattern C: Custom SaaS Fiscal Year starting Feb 1 (FY Quarters: Feb, May, Aug, Nov):
5 0 1 2,5,8,11 * /opt/finance/fiscal-quarter-rollover.sh
```

## Engineering Deep Dive

Unlike February (which oscillates between 28 and 29 days in leap years), the four standard calendar quarter-end months—March (31), June (30), September (30), and December (31)—have fixed lengths in every single year! That means even if a legacy system demands a snapshot at 23:55 on the final day of each calendar quarter, a static two-line split (day 31 in months 3,12 and day 30 in months 6,9) is 100% deterministic forever without needing shell date guards (unless your fiscal quarters end in February!).

Even better, financial engineering best practice favors running period-close aggregations right AFTER the boundary (such as 5 0 1 1,4,7,10 * at 00:05 on January 1, April 1, July 1, and October 1) and querying WHERE created_at >= quarter_start AND created_at < current_quarter_start. That single cron line works identically across POSIX cron, Kubernetes, GitHub Actions, EventBridge (cron(5 0 1 1,4,7,10 ? *)), PostgreSQL pg_cron, and systemd (OnCalendar=quarterly), and guarantees zero missed transactions between 23:55:00 and 23:59:59.999!

Always write explicit comma-separated month lists (1,4,7,10 or 3,6,9,12 or 2,5,8,11) rather than step syntax like */3 or 3-12/3. Explicit lists take the same 8 bytes of text and eliminate the perennial code-review confusion over whether */3 runs in January or March.

## Calendar & Fiscal Quarter Cron Reference

| Case / Engine | Protocol Behavior | Production Remediation |
| :--- | :--- | :--- |
| **Start of Q1, Q2, Q3, Q4 (Jan 1, Apr 1, Jul 1, Oct 1)** (`#calendar-quarter-start`) | Runs once per quarter immediately after the prior quarter closes. | 5 0 1 1,4,7,10 * (EventBridge: cron(5 0 1 JAN,APR,JUL,OCT ? *)) |
| **Last day of Q1–Q4 (Mar 31, Jun 30, Sep 30, Dec 31)** (`#calendar-quarter-end-day`) | Fixed month lengths (never involves Feb 28/29!). | Two rules: '55 23 31 3,12 *' and '55 23 30 6,9 *' (or systemd *-03,06,09,12-~01). |
| **SaaS Feb–Jan Fiscal Quarters (End Apr 30, Jul 31, Oct 31, Jan 31)** (`#retail-saas-feb-fiscal`) | Also avoids February month-end! Start dates are Feb 1, May 1, Aug 1, Nov 1. | Quarter start: 5 0 1 2,5,8,11 * \| Quarter end: 30 in month 4 + 31 in months 1,7,10. |
| **Fiscal Quarters ending Feb 28/29, May 31, Aug 31, Nov 30** (`#uk-april-fiscal-feb-end`) | Includes February month-end, so static day 28 breaks in leap years! | Run at start of next quarter (5 0 1 3,6,9,12 *) or use EventBridge 'L' / tomorrow guard. |

## Frequently Asked Engineering Questions

### What does @quarterly or systemd OnCalendar=quarterly expand to?

In systemd, OnCalendar=quarterly is strictly equivalent to *-01,04,07,10-01 00:00:00 (midnight at the start of Jan 1, Apr 1, Jul 1, Oct 1). Note that POSIX crontab does NOT standardize @quarterly (only Vixie @yearly/@monthly/@weekly/@daily/@hourly are widely portable), so write 0 0 1 1,4,7,10 * explicitly.

### Does 3/3 in the Month field work in POSIX crontab for Mar, Jun, Sep, Dec?

No! In standard Vixie Cron, 3/3 is a syntax error (steps require a range like 3-12/3 or wildcard */3), whereas in Quartz/EventBridge 3/3 means 'start at 3, step by 3'. Writing 3,6,9,12 works identically in 100% of parsers with zero ambiguity.

### What timezone should quarterly financial close jobs use?

Match the exact timezone stated in your customer contracts and general ledger (commonly Etc/UTC for SaaS usage metering, or America/New_York / Europe/London for statutory accounting cutoffs).

## Related Problem-Cluster Guides

- [Run a Cron Job on the Last Day of Every Month (28, 29, 30, and 31 Leap-Year Safe)](https://opslint.dev/cron/last-day-of-month-leap-year-cron-patterns/) — Portable month-end cron patterns across POSIX Linux/BSD, Kubernetes CronJob, GitHub Actions, AWS EventBridge (L), and systemd (~01) including February 29.
- [Nearest Weekday Payroll Cron Schedules: 15W and LW vs Portable POSIX Guards](https://opslint.dev/cron/nearest-weekday-payroll-schedule-15w/) — Translate AWS EventBridge 15W and LW nearest-business-day payroll modifiers to POSIX crontab, Kubernetes CronJob, and GitHub Actions without month-crossing bugs.
- [Cron Jobs Skipped During Daylight Saving Time Spring Forward (02:00–02:59 Gap)](https://opslint.dev/cron/dst-spring-forward-skipped-jobs/) — Why 02:30 local cron schedules vanish on Kubernetes CronJob and AWS EventBridge while Vixie Cron runs catch-up at 03:00, and how to prevent missed runs.
- [Prevent Duplicate Cron Execution During Daylight Saving Time Fall Back (01:00–01:59 Overlap)](https://opslint.dev/cron/dst-fall-back-duplicate-execution/) — Diagnose and prevent double-firing cron jobs during the November DST fall-back hour across Kubernetes CronJob, Vixie Cron, and AWS EventBridge.
