By Docify

Vixie Crontab vs Quartz: 5-Field vs 6/7

• 6 min read

Vixie crontab(5) is five fields — minute, hour, day-of-month, month, day-of-week — as shipped by Debian cron 3.0pl1. If both day fields are restricted (neither begins with *), Vixie ORs them. A field whose first character is * is star-like, so */2 ANDs. Quartz CronTrigger is six mandatory fields plus an optional year: seconds come first, Sunday is 1, and one day field must be ?. Docify explains Vixie only. Nothing is uploaded.

The same five tokens are not interchangeable. A line that is legal in a Linux crontab is incomplete in Quartz, and a Quartz line with ? or a leading seconds field is rejected by Vixie. The live cron explainer parses the Vixie five-field dialect only.

Field counts are not a style choice

Vixie: minute hour day month weekday

Debian crontab(5) for cron 3.0pl1 (Paul Vixie) is five schedule fields, then a command (or a username plus command in the system table). Minute is 0–59, hour 0–23, day-of-month 1–31 on this site, month 1–12, and day-of-week 0–7 with 0 and 7 both Sunday. * means first–last. Lists and numeric ranges are allowed. Steps are only after * or a-b. One three-letter English name is allowed for month or weekday; the same man page rejects lists or ranges of names.

30 4 1,15 * 5

Quartz 2.3: seconds first, optional year

Quartz CronTrigger is six mandatory fields — seconds, minutes, hours, day-of-month, month, day-of-week — and an optional seventh year (1970–2099). Seconds sit at the left, so a five-field Vixie line is not a Quartz line with the seconds omitted. Day-of-week is 1–7 or SUN–SAT, with 1 = Sunday. Specials on the day fields include ?, L, W, and # (Quartz 2.3 CronTrigger tutorial).

0 30 4 1,15 * ?

How the two day fields combine

Vixie ORs two restricted day fields

crontab(5) Note: if both day fields are restricted (neither begins with *), the command runs when either field matches. 30 4 1,15 * 5 is 04:30 on the 1st and 15th, plus 04:30 every Friday. That is a union, not “the 1st and 15th only when they are Friday.”

First-character * is star-like (AND)

Debian crontab(5) LIMITATIONS: POSIX is described as treating a day field as unrestricted only when it is exactly a star, so 0 0 */2 * sun would run every Sunday and on every odd day-of-month. This Vixie implementation checks only the first character, so */2 is star-like and both day fields must match (AND): midnight on Sundays that also fall on an odd date. Docify uses that first-character rule. It still does not expand a timezone or list the next fire times.

Quartz requires ? in one day field

Quartz 2.3 does not finish support for specifying both a day-of-month and a day-of-week value. One of those two fields must be ? (“no specific value”). 0 30 4 1,15 * 6 is invalid Quartz; use 0 30 4 1,15 * ? or 0 30 4 ? * 6 (6 = Friday when Sunday is 1). There is no Vixie-style OR of two numeric day fields.

Tokens that exist in only one dialect

Quartz ?, L, W, and #

? marks the unused day field. L is last day of month, or last weekday when written as 6L. W is the nearest weekday to a given date; LW is the last weekday of the month. 6#3 is the third Friday. None of these are Vixie crontab(5) syntax. Docify rejects them instead of guessing.

Vixie @nicknames, not @reboot

Vixie expands @yearly / @annually, @monthly, @weekly, @daily / @midnight, and @hourly to five-field schedules. @reboot is a startup hook, not a schedule, and is rejected here. Quartz does not use those nicknames.

Jenkins H and cronie ~

Jenkins hash-schedules with H. cronie (the man7 crontab(5) dialect) picks a random instant in a range with ~. Neither is Vixie 3.0pl1, and both are rejected. AWS EventBridge Scheduler uses a Quartz-shaped six-field line with ? — also not this explainer.

Weekday numbering trap

0 9 * * 1-5 is 09:00 Monday–Friday in Vixie. The Quartz spelling of the same intent is typically 0 0 9 ? * MON-FRI or 0 0 9 ? * 2-6 (Monday=2 when Sunday=1). Copying 1-5 into Quartz selects Sunday–Thursday. Three-letter names avoid the off-by-one when the runner accepts them. Vixie on this site still allows only one name per field, not MON-FRI.

Explain a Vixie five-field crontab

Minute hour day month weekday. Not Quartz. Nothing is uploaded.

Use Cron Explainer →

FAQ

Can I paste a Quartz expression into Docify’s cron explainer?
No. The live explainer is Vixie crontab(5) five-field only (Debian cron 3.0pl1). Six or seven fields, a leading seconds value, Quartz ? L W #, Jenkins H, and cronie ~ are rejected. It does not translate Quartz to Vixie and does not compute the next fire time.
Why does 30 4 1,15 * 5 run on Fridays and on the 1st and 15th?
In Vixie crontab(5), if both day fields are restricted (neither begins with *), the days are OR-ed. 30 4 1,15 * 5 is the man-page example: 04:30 on the 1st and 15th, and also 04:30 every Friday. Quartz cannot express that union: one of the two day fields must be ? (“no specific value”).
Does */2 in a day field OR or AND with the other day field?
Debian crontab(5) documents that this Vixie implementation treats a day field as star-like when its first character is *. So 0 0 */2 * sun ANDs: midnight only on Sundays that also fall on an odd day-of-month. The same LIMITATIONS note says POSIX would run that line every Sunday and on every odd date (a union). Docify follows the Debian first-character-* rule and still does not list next-run times.
Is Sunday 0, 1, or 7?
Vixie crontab(5) numbers day-of-week 0–7 with 0 and 7 both Sunday. Quartz 2.3 numbers day-of-week 1–7 with 1 = Sunday and 7 = Saturday (or SUN–SAT names). The same digit 1 is Monday in Vixie and Sunday in Quartz. Prefer three-letter names when a runner accepts them.

Related