-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New feature: Option for legacy dom-OR-dow #53
Comments
I was only following at&t and BSD convention which later became POSIX. It may not be great but it is expected behaviour.
Get BlueMail for Android
On Feb 15, 2022, 22:00, at 22:00, Hexagon ***@***.***> wrote:
By default, croner work differently from the standard refered to by
***@***.*** If you specify both day-of-month and day-of-week ( `0 0 1 *
…MON`) croner would only run when there is a monday at the 1st of any
month. This enable you to set patterns that run on the first monday of
any month (`0 0 1-7 * MON`) and other clever stuff.
In classic cron (Vixie, for example), day-of-month and day-of-week are
ORed, which makes `0 0 1 * MON` run at the 1st of any month **AND** at
mondays.
```c
/* the dom/dow situation is odd. '* * 1,15 * Sun' will run on the
* first and fifteenth AND every Sunday; '* * * * Sun' will run
*only*
* on Sundays; '* * 1,15 * *' will run *only* the 1st and 15th. this
* is why we keep 'e->dow_star' and 'e->dom_star'. yes, it's bizarre.
* like many bizarre things, it's the standard.
*/
```
-
https://github.com/vixie/cron/blob/690fc534c7316e2cf6ff16b8e83ba7734b5186d2/cron.c#L299
Croner should support this with options, maybe
```javascript
{
legacyMode: true
}
```
--
Reply to this email directly or view it on GitHub:
#53
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Implemented in 4.2.0 |
Legacy mode (dom-OR-dow) is default from 5.0.0 You can switch to "croner mode" (dom-AND-dow) by passing option |
nice. thanks. |
Hi, In Uptime Kuma this option might introduce a feature I would find helpful. However, there are concerns that this option is not there to stay due to the name containing the word "legacy" and if/when it's deprecated this would cause issues. Is the |
The option legacyMode: true/false is a permanent feature, and will never be be deprecated. The word legacy is used to indicate that the pattern is treated the same way as legacy tools, and is the default mode since 5.0... Setting legacyMode to false enables extra features, and will probably always be a opt-in. |
seems legit to me. |
By default, croner work differently from the standard refered to by @vixie. If you specify both day-of-month and day-of-week (
0 0 1 * MON
) croner would only run when there is a monday at the 1st of any month. This enable you to set patterns that run on the first monday of any month (0 0 1-7 * MON
) and other clever stuff.In classic cron (Vixie, for example), day-of-month and day-of-week are ORed, which makes
0 0 1 * MON
run at the 1st of any month AND at mondays.Croner should support this with options, maybe
The text was updated successfully, but these errors were encountered: