-
Notifications
You must be signed in to change notification settings - Fork 84
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
how about week number? #66
Comments
The question is how to introduce that in a backwards compatible way. |
is it possible to steal the weekday field? |
0-7 are valid day of a week numbers. |
that's why has to steal it |
This would also provide a close-enough alternative for running tasks e.g. every 1st/2nd/3rd Wednesday of the month, which AFAICT is not possible with current cron features (except possibly with some weird tricks). While I understand current cron syntax has gone largely unchanged for a long time and must retain compatibility, perhaps there could be a scheme that can also allow new features to be introduced:
The fact that all the fields are logical ANDs except if both day of month and weekday are specified is a counterintuitive exception that can cause confusion (and makes it impossible to do Nth Wednesday of a month) so I would suggest that if a new field is added it should have the usual logical AND behaviour. Aside from being able to support new features, this would also have the benefit of being more user-friendly and human-comprehensible. If each field is named, the intent is clear and unambiguous, so it would be possible to allow any order of fields and omission of fields ('*' by default), meaning you don't have to memorize or look up the syntax to know the meaning of each field. You could for example write:
|
@rptaylor Nice idea! That should be implementable in backwards compatible way. Anybody wants to try this? |
I'm not a developer per se but I will enthusiastically thumbs up emoji to any implementation attempt. |
Hi guys,
just wondering if a new field "week number" (in a year scale?i.e. 52 max? or in a month scale?i.e. 5 max? how about February?) could be introduced to crontab? so that many people are asking various "week"-dependent questions would be somewhat easier to solve? e.g. 3rd Monday of every/alternate month...etc
The text was updated successfully, but these errors were encountered: