Quartz Cron ? (Question Mark)
Quartz cron (used by Java, Spring Quartz, Elastic) has 6 or 7 fields and a ? symbol. You put ? in either day-of-month or day-of-week to mean 'no specific value', because Quartz does not allow both of those fields to be set at once.
Why ? exists
Quartz fields are sec min hour day-of-month month day-of-week [year]. You cannot specify day-of-month and day-of-week together, so one of them must be ?. Noon every weekday: 0 0 12 ? * MON-FRI — day-of-month is ? because the day-of-week field is doing the work.
? vs *
* means 'every value'; ? means 'leave this field unspecified'. Use ? only in day-of-month or day-of-week. On the 1st of every month at midnight: 0 0 0 1 * ? — now day-of-week is ?.
Six fields, not five
Remember Quartz starts with seconds. A classic Linux 5-field line is invalid in Quartz — add a leading seconds field and a day-of-week placeholder.
FAQ
What does ? mean in a Quartz cron expression?
'No specific value.' Quartz can't set day-of-month and day-of-week at the same time, so you put ? in whichever one you're not using.
What's the difference between ? and * in Quartz cron?
* means every value in the field; ? means leave it unspecified. ? is only valid in the day-of-month and day-of-week fields.
Why is my Linux crontab line rejected by Quartz?
Quartz uses 6-7 fields starting with seconds and requires a ? in day-of-month or day-of-week. A 5-field Linux line is invalid — add seconds and a ? placeholder.