-
Notifications
You must be signed in to change notification settings - Fork 78
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
step in crontab doesn't function as expected when it isn't an even divisor of range #142
Comments
This implementation was there basically forever and I do not think changing it at this point makes sense. So yeah, this is a documenation issue. |
Yeah, I took a look at the code when submitting this and I figured that's what you would say. ;-) Certainly too much work / disruption to change the behavior. Having said that, is somewhere in the distribution, either the man page or somewhere else, where it would be appropriate to give examples of how to implement the desired frequency? Something like this:
ETA: I originally tried to use |
The second example is still not correct - You should use something like Not sure what would you like to achieve with $RANDOM_DELAY as that would be a fixed value anyway. I think it could be placed somewhere in crontab(5) in NOTES section perhaps. |
Good catch, thanks. New examples:
Upon further reflection I think I misunderstood what
Sounds reasonable. Would you take a PR if I submit one? |
yes, sure |
Add a NOTES section explaining how you can run a job, e.g., every 58 minutes or every 23 hours, since the /# skip syntax doesn't support that. As per cronie-crond#142.
Add a NOTES section explaining how you can run a job, e.g., every 58 minutes or every 23 hours, since the /# skip syntax doesn't support that. As per #142.
If I specify
*/59 * * * *
in a crontab, then I expect the job to run every 59 minutes, with minute of the time the job executes decreasing by one minute every hour. For example, at some point the sequence of run times might be 13:02, 14:01, 15:00, 15:59, etc.Instead, what happens is that the job runs every :00 and :59 of the hour, which means that it runs twice per hour, one minute apart.
This is, at best, unexpected behavior given what it says in the man page, and the man page should be updated to reflect it. At worst, it's a bug. I, personally, would certainly prefer for this to work as described in the first paragraph.
The text was updated successfully, but these errors were encountered: