1. Introduction

A five-field cron line (minute hour day-of-month month day-of-week) schedules GitHub Actions workflows, Kubernetes CronJobs, backup scripts, monitoring checks and, increasingly, tasks that coding agents set up for users. A line is often written for one runtime and later evaluated by another. Examples are a Python scheduler that reads a crontab, a monitoring service that predicts the next check-in, and a dashboard that shows the next run. POSIX [1] defines a minimal syntax with plain values, ranges and lists. It also says that when day-of-month and day-of-week are both specified as elements or lists, a day matching either one runs. The de facto reference in Linux distributions is cronie’s crontab(5) [2]. It adds steps (*/15), month and weekday names, 7 for Sunday and the @daily-style macros. It also defines “restricted” as a field that does not contain *, so */2 in day-of-month leaves the day fields combined with AND. Libraries reimplement this independently. We ask: given the same line and the same start instant, do they produce the same next fire times?

Differential testing [3] compares implementations on shared inputs. Closest to this paper, Sentry’s migration from croniter to cronsim [4] compared next-run times for every schedule in its production database over 2024, published 24 diverging expressions, and attributed them to croniter’s step handling. That comparison covers two Python libraries. Four of our cases are taken from the expressions it lists (S10, S13, D12 with 3 for WED, D13), and D11 is modelled on its */100,1-7 line. A pre-port investigation of cron-parser [5] compares cron-parser and robfig/cron under daylight-saving transitions. CronRadar’s survey of cron daemons [6] documents the “starts with *” rule and that fcron and systemd-cron use AND for the day fields. APScheduler documents its Monday-0 numbering in the from_crontab docstring and issue 286 [7], and croniter’s README calls the cronie day rule a bug and offers implement_cron_bug [8]. Each source covers one library or one daemon. We found no matrix that runs one case set across libraries in several languages.

3. Method

Subjects. Nine libraries, each called through its public API with default options and UTC.

  • Python: croniter 7.0.0 (croniter(expr, start).get_next), cronsim 2.8 (CronSim), and APScheduler 3.11.3 (CronTrigger.from_crontab(expr, timezone=UTC).get_next_fire_time).
  • Node v24.22.1: cron-parser 5.10.6 (CronExpressionParser.parse, with hashSeed: 'pubroot' so that H is reproducible), croner 11.0.1 (nextRuns), and cron 4.4.0 (CronTime.sendAt iterated).
  • Go 1.27.3: robfig/cron v3.0.1 (ParseStandard), adhocore/gronx v1.20.7 (IsValid then NextTickAfter), and hashicorp/cronexpr v1.1.3 (Parse, NextN).

Each (library, case) pair runs with a 10-second limit and keeps any fire times produced before an error or the limit. CPython 3.13.5.

Cases. gen_cases.py writes 83 cases: basic forms (9), steps (14), day-of-month/day-of-week combination (13), names (11), Sunday as 7 (5), range and syntax errors (13), @ macros (8), Quartz/Jenkins extensions L, 5L, 1#2, ?, H, 15W (6), and whitespace variants (4). For each case, a brute-force scan of every minute (up to 40 years) under crontab(5) gives the reading: five UTC fire times, invalid, or never (0 0 30 2 *). Seventeen cases are open, because the manual does not define them. These are a step after a single value (5/15), a zero step, a *-led list in the day field, six fields, @midnight, the extensions and the whitespace variants. Open cases are reported but not scored. The scan is our implementation of the manual’s text.

Classes (analyze.py). A: the output equals the reading, or rejects an invalid line. For never, rejecting and returning no times both count as A. S: accepted, but with a different schedule. R: rejected a valid line. L: accepted an invalid line and produced times. L0: accepted an invalid line but never fires.

Reproduce.

git clone https://github.com/buildngrowsv/pubroot-pilots && cd pubroot-pilots
git checkout 3da72ec8733e5d49b1a92ef46e3a458cacae086f
cd cron-schedules/js && npm ci && cd ..
python3 -m venv .venv && .venv/bin/pip install -r py/requirements.txt
PY=.venv/bin/python ./run_all.sh

Folder: https://github.com/buildngrowsv/pubroot-[REDACTED_SECRET]-schedules/

Two runs in the working tree and a third from a git archive export with fresh installs produced byte-identical results/ files.

4. Results

Outputs differed on 45 of 83 cases, with at most three distinct outputs per case. On 33 of the 66 cases with a defined reading, at least one library departed from it. Class counts over the 66 scored cases (A/S/R/L/L0) were as follows.

LibraryASRLL0
croniter594030
cronsim600600
APScheduler43111200
cron-parser603120
croner623100
cron614100
robfig/cron583320
gronx650010
cronexpr563232

Pairwise, two libraries disagreed on between 9 cases (cronsim and gronx) and 36 (APScheduler and croniter). Plain fields, lists, ranges, most steps and lower-case names were unanimous.

Weekday numbering. APScheduler 3.x’s from_crontab numbers weekdays from Monday = 0, which its docstring calls a historical mistake fixed in 4.x [7]. 0 0 * * 0 therefore fires on Monday 5 January instead of Sunday 4 January (B07). Every weekday-restricted case shifts by one day (D01–D06, D10, N09, N10). 7, 0,7, 5-7, SUN-SAT and all six @ macros are rejected. APScheduler also combines day-of-month and day-of-week with AND, which moves 30 4 1,15 * 5 from 1 January to 1 August.

Sunday as 7. cronie accepts 7 for Sunday. robfig/cron rejects 7, 0,7 and 5-7. cron-parser rejects 0,7 but accepts 7. cronexpr accepts 5-7 but treats it as Friday–Saturday (W03).

Day fields that start with *. For 0 9 */2 * 1 (D04), cronie treats the day-of-month field as unrestricted because it contains *, so the line means “odd-numbered days that are Mondays”, first on 5 January. Only cronsim and gronx agree. croniter, cron-parser, croner, cron, robfig/cron and cronexpr use OR and fire on 1 January. The same split holds for 0 10 */14 * 3 (D12) and 0 4 1-7 * */7 (D13). APScheduler and cronexpr reject */7 in the weekday field because the step exceeds the range. Where both fields are plainly restricted (D01–D03, D05, D10), all libraries except APScheduler use cronie’s OR.

Steps. croniter 7.0.0 still reads 20-59/5 1-1 * * * (S13) as starting at 00:20 rather than 01:20, the same output Sentry recorded for a 2024 croniter [4]. APScheduler, croner and cronexpr reject 0 0 */45 * *, which cronie accepts and fires on the 1st.

Invalid input accepted. cron-parser accepts the empty string (R10) and the four-field * * * * (R08), and fires every minute for both. robfig/cron accepts 1,,2, and cronexpr accepts it too. robfig/cron and gronx accept +5 as minute 5. croniter and cronexpr accept reversed ranges (5-1, FRI-MON, 6-0). croniter fires on them, while cronexpr returns no times for 5-1 and FRI-MON (L0), an accepted schedule that never runs. cronexpr also accepts MONDAY.

Macros and horizon. cronsim and APScheduler reject every @ macro, and cron rejects @annually. cron searches at most eight years past the current wall-clock time. For 0 0 29 2 * (D09) it therefore returns only 2028 and 2032, and the result depends on the date of the run.

Open cases. Six libraries accept L, five accept 5L, six accept 1#2 and ?, four accept 15W, and only cron-parser accepts Jenkins H (hashed with a fixed seed). Where the extensions were accepted, the fire times agreed. On 1 1 */32,1-7 * 2 (D11), croniter, cron and robfig/cron fire on 1 January (OR) while cronsim and gronx wait for Tuesday 6 January (AND). These are the two behaviours croniter’s implement_cron_bug switches between.

5. Real-world sample

On 2026-11-16 we ran a read-only GitHub code search (REST API, signed in) for "- cron:" path:.github/workflows and took the first 300 results (245 workflow files). We extracted 267 cron: values, which held 137 distinct expressions; only the expressions and their counts are committed. Outputs differed on 53 expressions (84 occurrences). APScheduler deviated on 51 of them (82 occurrences). Forty-seven set a day-of-week (for example 0 0 * * 1, eight files) and were shifted by one day, and four used steps that APScheduler rejects (*/60 * * * *, 0 */24 * * *, 56 */24 * * *, 0 0 * * */7). cronexpr rejected the same four step expressions (seven occurrences), and robfig/cron and cronexpr accepted the invalid 0 1, * * *. 0 0/1 * * * (a step after a single value) is open under crontab(5); croner rejected it and the other eight fire hourly. Two values (weekly on sunday, weekly on tuesday) are not cron and were rejected by all. croniter, cronsim, cron-parser, croner, cron, gronx and robfig/cron agreed with the crontab(5) reading on every valid expression in the sample. In practice, the risk is concentrated in APScheduler 3.x weekday numbering and in step validation.

6. Implications (hypotheses)

Hypothesis: a schedule copied from a GitHub Actions workflow or a crontab into APScheduler 3.x from_crontab runs one day late whenever it names a weekday, and nothing reports an error. Hypothesis: “first Monday of the month” written as 0 9 1-7 * 1 runs on days 1–7 and every Monday in every library except APScheduler, while the *-led variants used as workarounds behave differently across libraries. Hypothesis: monitoring services that predict the next run with a different library from the one that executes the job will raise false missed-run alerts on the cases in Appendix A. Hypothesis: agents that emit numeric five-field lines without 7, macros, combined day fields or steps that do not divide their range avoid every disagreement we measured. We did not test any agent.

7. Threats to validity

  • Reference. cronie’s crontab(5) is one daemon’s manual. Other daemons (fcron, systemd-cron, BusyBox) differ on the day rule [6], and some libraries deliberately follow Quartz. Our classes encode cronie, while the raw outputs in results/ do not depend on that choice.
  • Synthetic cases. These show that behaviours differ, not how often they occur. The real-world sample is one search snapshot of public workflows and is biased towards GitHub Actions usage.
  • UTC only, one start instant. We did not test time zones or daylight-saving transitions, where [5] reports further differences, nor restarts mid-month, where [4] found croniter’s month-boundary step errors.
  • Wall-clock dependence. cron’s eight-year cap makes D09 depend on the run date. All other cases are independent of it.
  • Versions. One version per library. APScheduler 4.x fixes the weekday numbering but was still a pre-release on the test date.

8. Conclusion

Nine cron libraries in three languages disagreed on 45 of 83 cases. The splits concentrate on four questions. Does 0 or 1 mean Monday? Does 7 mean Sunday? Is a day field that starts with * restricted? Should a malformed line fail? On plain numeric lines the libraries agree, and the real-world sample shows that most workflow schedules are plain. The exceptions are weekday lines under APScheduler 3.x and steps such as */60. Before relying on a schedule in a second runtime, test it in that runtime. The case set in Appendix A can serve as a regression suite.

Appendix A. Full case list and verdict matrix

Columns: ci croniter, cs cronsim, ap APScheduler, cp cron-parser, cn croner, cr cron, rf robfig/cron, gx gronx, ce cronexpr. Times are UTC, written MM-DD HH:MM for 2026 and with the year otherwise. The start is 2026-01-01T00:00:30Z. “Reading” gives the first and fifth fire times under crontab(5). Cells:

  • ✓ means class A.
  • “Sk t” means the library’s k-th fire time is the first to differ from the reading, and shows that time. “S3 end” means the library stopped after two times.
  • R means a valid line was rejected.
  • “L t” means an invalid line was accepted with first time t, and L0 means it was accepted but never fires.
  • For open cases the cell shows the first time, or “rej”.
  • For never, “✓ rej” and “✓ none” distinguish a rejection from an empty result.

Unanimous cases (identical output from all nine libraries; first … fifth fire time): B01 * * * * * → 01-01 00:01 … 01-01 00:05; B02 0 * * * * → 01-01 01:00 … 01-01 05:00; B03 30 4 * * * → 01-01 04:30 … 01-05 04:30; B04 0 0 1 1 * → 2027-01-01 00:00 … 2031-01-01 00:00; B05 15,45 * * * * → 01-01 00:15 … 01-01 02:15; B06 0 9-17 * * * → 01-01 09:00 … 01-01 13:00; B08 00 05 * * * → 01-01 05:00 … 01-05 05:00; B09 0 0 01 01 * → 2027-01-01 00:00 … 2031-01-01 00:00; S01 */15 * * * * → 01-01 00:15 … 01-01 01:15; S02 0 */6 * * * → 01-01 06:00 … 01-02 06:00; S03 0-30/10 * * * * → 01-01 00:10 … 01-01 01:10; S04 0 0 */10 * * → 01-11 00:00 … 02-11 00:00; S05 0 0 1-31/10 * * → 01-11 00:00 … 02-11 00:00; S06 */7 * * * * → 01-01 00:07 … 01-01 00:35; S07 0 */23 * * * → 01-01 23:00 … 01-03 23:00; S09 0 0 1 */5 * → 06-01 00:00 … 2027-11-01 00:00; S12 */0 * * * * → open, all rej; S14 0 0 */3 * * → 01-04 00:00 … 01-16 00:00; D07 0 0 31 * * → 01-31 00:00 … 08-31 00:00; N01 0 0 * * MON → 01-05 00:00 … 02-02 00:00; N02 0 0 * * mon → 01-05 00:00 … 02-02 00:00; N03 0 0 * * Mon-Fri → 01-02 00:00 … 01-08 00:00; N04 0 0 1 JAN,JUL * → 07-01 00:00 … 2028-07-01 00:00; N05 0 0 1 jan-mar * → 02-01 00:00 … 2027-03-01 00:00; N11 0 0 1 Jan * → 2027-01-01 00:00 … 2031-01-01 00:00; W04 0 0 * * 8 → invalid; R01 60 * * * * → invalid; R02 * 24 * * * → invalid; R03 * * 0 * * → invalid; R04 * * 32 * * → invalid; R05 * * * 13 * → invalid; R06 * * * 0 * → invalid; R12 1- * * * * → invalid; M08 @reboot → open, all rej; F01 0 0 * * * → open, all 01-02 00:00; F02 0 0 * * * → open, all 01-02 00:00; F03 0 0 * * * → open, all 01-02 00:00; F04 0 0 * * * → open, all 01-02 00:00.

Cases with differing outputs:

IDExpressionReading (1st … 5th)cicsapcpcncrrfgxce
B070 0 * * 001-04 00:00 … 02-01 00:00✓✓S1 01-05 00:00✓✓✓✓✓✓
S080 0 */45 * *02-01 00:00 … 06-01 00:00✓✓R✓R✓✓✓R
S100 23/2,1-10/2 * * *open01-01 01:0001-01 01:00rej01-01 01:00rej01-01 01:0001-01 01:0001-01 01:0001-01 01:00
S115/15 * * * *open01-01 00:0501-01 00:0501-01 00:0501-01 00:05rej01-01 00:0501-01 00:0501-01 00:0501-01 00:05
S1320-59/5 1-1 * * *01-01 01:20 … 01-01 01:40S1 01-01 00:20✓✓✓✓✓✓✓✓
D0130 4 1,15 * 501-01 04:30 … 01-16 04:30✓✓S1 08-01 04:30✓✓✓✓✓✓
D020 0 13 * 501-02 00:00 … 01-23 00:00✓✓S1 06-13 00:00✓✓✓✓✓✓
D030 9 1-7 * 101-01 09:00 … 01-05 09:00✓✓S1 01-06 09:00✓✓✓✓✓✓
D040 9 */2 * 101-05 09:00 … 03-09 09:00S1 01-01 09:00✓S1 01-13 09:00S1 01-01 09:00S1 01-01 09:00S1 01-01 09:00S1 01-01 09:00✓S1 01-01 09:00
D050 0 1 * 1-501-02 00:00 … 01-08 00:00✓✓S1 04-01 00:00✓✓✓✓✓✓
D060 0 * 6 106-01 00:00 … 06-29 00:00✓✓S1 06-02 00:00✓✓✓✓✓✓
D080 0 30 2 *never✓ rej✓ rej✓ none✓ rej✓ none✓ rej✓ none✓ rej✓ none
D090 0 29 2 *2028-02-29 00:00 … 2044-02-29 00:00✓✓✓✓✓S3 end✓✓✓
D100 0 29 2 102-02 00:00 … 2027-02-01 00:00✓✓S1 2028-02-29 00:00✓✓✓✓✓✓
D111 1 */32,1-7 * 2open01-01 01:0101-06 01:01rejrejrej01-01 01:0101-01 01:0101-06 01:01rej
D120 10 */14 * 304-01 10:00 … 07-15 10:00S1 01-01 10:00✓S1 01-01 10:00S1 01-01 10:00S1 01-01 10:00S1 01-01 10:00S1 01-01 10:00✓S1 01-01 10:00
D130 4 1-7 * */701-04 04:00 … 05-03 04:00S1 01-01 04:00✓RS1 01-01 04:00S1 01-01 04:00S1 01-01 04:00S1 01-01 04:00✓R
N060 0 * * SUN-SAT01-02 00:00 … 01-06 00:00✓✓R✓✓✓✓✓✓
N070 0 * * MONDAYinvalid✓✓✓✓✓✓✓✓L 01-05 00:00
N080 0 * * FRI-MONinvalidL 01-02 00:00✓✓✓✓✓✓✓L0
N090 0 * * 1-5/201-02 00:00 … 01-12 00:00✓✓S1 01-03 00:00✓✓✓✓✓✓
N100 0 * * MON-FRI/201-02 00:00 … 01-12 00:00✓✓S3 01-06 00:00✓✓✓✓✓✓
W010 0 * * 701-04 00:00 … 02-01 00:00✓✓R✓✓✓R✓✓
W020 0 * * 0,701-04 00:00 … 02-01 00:00✓✓RR✓✓R✓✓
W030 0 * * 5-701-02 00:00 … 01-10 00:00✓✓R✓✓✓R✓S3 01-09 00:00
W050 0 * * 6-0invalidL 01-03 00:00✓✓✓✓✓✓✓L 01-03 00:00
R075-1 * * * *invalidL 01-01 00:01✓✓✓✓✓✓✓L0
R08* * * *invalid✓✓✓L 01-01 00:01✓✓✓✓✓
R09* * * * * *open01-01 00:0001-01 00:00rej01-01 00:0001-01 00:0001-01 00:00rej01-01 00:0001-01 00:01
R10(empty)invalid✓✓✓L 01-01 00:01✓✓✓✓✓
R111,,2 * * * *invalid✓✓✓✓✓✓L 01-01 00:01✓L 01-01 00:01
R13+5 * * * *invalid✓✓✓✓✓✓L 01-01 00:05L 01-01 00:05✓
M01@daily01-02 00:00 … 01-06 00:00✓RR✓✓✓✓✓✓
M02@hourly01-01 01:00 … 01-01 05:00✓RR✓✓✓✓✓✓
M03@weekly01-04 00:00 … 02-01 00:00✓RR✓✓✓✓✓✓
M04@monthly02-01 00:00 … 06-01 00:00✓RR✓✓✓✓✓✓
M05@yearly2027-01-01 00:00 … 2031-01-01 00:00✓RR✓✓✓✓✓✓
M06@annually2027-01-01 00:00 … 2031-01-01 00:00✓RR✓✓R✓✓✓
M07@midnightopen01-02 00:00rejrejrej01-02 00:00rej01-02 00:00rejrej
X010 0 L * *open01-31 00:0001-31 00:00rej01-31 00:0001-31 00:00rejrej01-31 00:0001-31 00:00
X020 0 * * 5Lopenrej01-30 00:00rej01-30 00:0001-30 00:00rejrej01-30 00:0001-30 00:00
X030 0 * * 1#2open01-12 00:0001-12 00:00rej01-12 00:0001-12 00:00rejrej01-12 00:0001-12 00:00
X040 0 ? * *open01-02 00:00rejrej01-02 00:0001-02 00:00rej01-02 00:0001-02 00:0001-02 00:00
X05H * * * *openrejrejrej01-01 00:11rejrejrejrejrej
X060 0 15W * *open01-15 00:00rejrejrej01-15 00:00rejrej01-15 00:0001-15 00:00

References

  1. IEEE Std 1003.1-2024 (POSIX), crontab utility. https://pubs.opengroup.org/onlinepubs/9799919799/utilities/crontab.html
  2. cronie, man/crontab.5 at commit cb49729da91af528805aadf2faa4da27cb36edec. https://github.com/cronie-[REDACTED_SECRET].5
  3. W. M. McKeeman. Differential Testing for Software. Digital Technical Journal 10(1), 1998.
  4. getsentry/sentry issue 80208, “crons: Migrate to Cronsim library over croniter”. https://github.com/getsentry/sentry/issues/80208
  5. S. Sah. port-mortem-cron-parser, FINDINGS.md (cron DST behaviour, cron-parser vs robfig/cron), 2026. https://github.com/sanjaysah101/port-mortem-cron-parser/blob/main/FINDINGS.md
  6. CronRadar. Cron Implementations: cronie, Debian, BusyBox, and fcron. https://cronradar.com/blog/cron-implementations
  7. agronholm/apscheduler, CronTrigger.from_crontab docstring (3.11.3) and issue 286. https://github.com/agronholm/apscheduler/issues/286
  8. pallets-eco/croniter, README, “Vixie cron bug compatibility”. https://github.com/pallets-eco/croniter