You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While normally the job is executed when the time/date specification fields all match the current time and date, there is one exception: if both "day of month" (field 3) and "day of week" (field 5) are restricted (not "*"), then one or both must match the current day.[3]
Wouldn't that mean strictly *, not */10? With * meaning all and Dom and Dow being an OR, * being a special case makes sense since you can't use a value outside the range.
I'm wondering whether starBit should be set in the case of */10 since it really does't mean all.
Fwiw, I think that the old behavior may have been correct here? The Wikipedia page looks to have been updated to match the man page:
Wikipedia:
While normally the job is executed when the time/date specification fields all match the current time and date, there is one exception: if both "day of month" (field 3) and "day of week" (field 5) are restricted (not contain "*"), then one or both must match the current day.[7]
man page:
The day of a command's execution can be specified in the
following two fields — 'day of month', and 'day of week'. If
both fields are restricted (i.e., do not contain the "*"
character), the command will be run when either field matches the
current time. For example,
"30 4 1,15 * 5" would cause a command to be run at 4:30 am on the
1st and 15th of each month, plus every Friday.
Meaning */10, which does contain a star, should be parsed as 'unrestricted', leading to the AND behavior not the OR behavior.
Came here after looking for a way to implement the behavior outlined in this blog post and wondering if this library implemented the AND or the OR.
It's pretty esoteric behavior but I figured I'd point it out since I noticed.
While normally the job is executed when the time/date specification fields all match the current time and date, there is one exception: if both "day of month" (field 3) and "day of week" (field 5) are restricted (not contain "*"), then one or both must match the current day.[7]
I think that we have to reference to the standard, instead of wikipedia. Below is the POSIX description:
If either the month or day of month is specified as an element or list, but the day of week is an , the month and day of month fields shall specify the days that match. If both month and day of month are specified as an , but day of week is an element or list, then only the specified days of the week match. Finally, if either the month or day of month is specified as an element or list, and the day of week is also specified as an element or list, then any day matching either the month and day of month, or the day of week, shall be matched.
@CompuRoot The POSIX standard does not appear to handle slashes at all:
Each of these patterns can be either an <asterisk> (meaning all valid values), an element, or a list of elements separated by <comma> characters. An element shall be either a number or two numbers separated by a <hyphen-minus> (meaning an inclusive range).
@williambanfield
Not sure if you still need this, but I had the same issue today and still needed the other behavior for a proof of concept. Other libraries may do what is needed, example based on my understanding thus far:
Activity
robfig commentedon Sep 14, 2016
I believe that is due to my reading of https://en.wikipedia.org/wiki/Cron:
lukescott commentedon Sep 14, 2016
Wouldn't that mean strictly
*, not*/10? With*meaning all and Dom and Dow being an OR,*being a special case makes sense since you can't use a value outside the range.I'm wondering whether starBit should be set in the case of
*/10since it really does't mean all.robfig commentedon Sep 14, 2016
Yeah, I agree
lukescott commentedon Sep 14, 2016
@robfig when I remove starBit when step > 1 the following test fails:
Just want to make sure I'm not missing something here. Since Dom and Dow is an OR, it actually should be
2012-08-01 00:00:00 +0000 UTCright?Changes made:
robfig commentedon Sep 14, 2016
I imagine the test is wrong in that case
parser: fix combining of Dow and Dom
robfig commentedon Jun 15, 2019
This is fixed on v3 branch.
parser: fix combining of Dow and Dom
williambanfield commentedon Apr 2, 2024
Fwiw, I think that the old behavior may have been correct here? The Wikipedia page looks to have been updated to match the man page:
Wikipedia:
man page:
Meaning
*/10, which does contain a star, should be parsed as 'unrestricted', leading to the AND behavior not the OR behavior.Came here after looking for a way to implement the behavior outlined in this blog post and wondering if this library implemented the AND or the OR.
It's pretty esoteric behavior but I figured I'd point it out since I noticed.
CompuRoot commentedon Oct 22, 2024
@williambanfield
I think that we have to reference to the standard, instead of wikipedia. Below is the POSIX description:
It weird, but it the standard. Here is 10 years old discussion about this.
williambanfield commentedon Oct 22, 2024
@CompuRoot The POSIX standard does not appear to handle slashes at all:
andrewbulin commentedon Dec 10, 2024
@williambanfield
Not sure if you still need this, but I had the same issue today and still needed the other behavior for a proof of concept. Other libraries may do what is needed, example based on my understanding thus far:
https://go.dev/play/p/WWM6g3kPuAv