-
Notifications
You must be signed in to change notification settings - Fork 200
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
Scheduling on tuesday every other week #259
Comments
Hello, I did my own google search and every one seems to be implementing her/his own version of the "final check". https://serverfault.com/questions/633264/cronjob-run-every-two-weeks-on-saturday-starting-on-this-saturday I'd say go with your final check. Maybe I should allow for some kind of guard when setting up Best regards and thanks for Ramaze and friends. |
Thanks for the answer, I went ahead with the final check, it's a one-liner anyway but splits the logic in two places which I'm not a big fan of. Either way I think it'd be a pretty useful feature but it's understandable that you wouldn't implement something that's not supported by anything else (and would make calculations even more difficult). |
Should it look like |
Moved issue to Thanks again. |
Another way: scheduler.every('2w', first: next_tuesday_at_midnight()) do
# ...
end |
I'm trying to figure out a way to specify a schedule that occurs every two weeks on Tuesday. So far I've only come up with
0 0 * * tue#2,tue#4
, which is not correct as a month may have between 4-5 Tuesdays.Is there some way to solve this issue using
Rufus::Scheduler::CronLine
or should I implement a final check in my code and simply call it every Tuesday likeDate.today.cweek % 2 == 0
?The text was updated successfully, but these errors were encountered: