Jelle Vegter
08/30/2021, 11:15 AMBouke Krom
08/30/2021, 12:10 PMexecution_day
is a Task
in the Flow
context. The blunt way would be to just fail the task (raise an exception or something) if the day is not right.Amanda Wee
08/30/2021, 12:13 PMJeremiah
Clock
(so a candidate event is created for every day), then use filters.is_month_end
to only keep the candidate events corresponding to the end of the month, then use adjustments.add
to add negative four days to the candidate event. The final event would be 4 days prior to a month end.
Recognizing that this is a little convoluted, I do have good news: we are actively working on schedule enhancements that anticipate your use case in a more first class way.Wilson Bilkovich
08/30/2021, 2:23 PMcron
syntax?Wilson Bilkovich
08/30/2021, 2:27 PM0 8 L-4 * *
should be ‘8th hour of every 4th-from-month-end’Jeremiah
Wilson Bilkovich
08/30/2021, 2:29 PMJelle Vegter
08/30/2021, 2:31 PMWilson Bilkovich
08/30/2021, 2:32 PMWilson Bilkovich
08/30/2021, 2:32 PMKevin Kho
Jeremiah
CronClock
uses croniter
under the hood and it looks like the syntax is either #<number>
or L<number>
according to its docs https://github.com/kiorky/croniter#usageKevin Kho
Jelle Vegter
08/30/2021, 2:43 PMBouke Krom
08/30/2021, 2:47 PMponder for a minuteIs that
* * * * *
?Wilson Bilkovich
08/30/2021, 2:48 PM0 8 24-27 * * [ `/bin/date -d +4day +\%d` -eq 1 ]
would work? That’s another slightly-more-standard-ish way to express itWilson Bilkovich
08/30/2021, 2:49 PMWilson Bilkovich
08/30/2021, 2:52 PMdate
expression, we could probably do better. For example on a BSD date
it would need to be something like /bin/date -v +4d +%d
Kevin Kho
croniter
. croniter
has an example iter = croniter('0 0 * * 5#3,L5', base)
like what Jeremiah suggested, but I tried this out using print(croniter.is_valid("0 0 * * 5#3,L5"))
and it printed False….
So I think this might be more on an issue with croniter
. I’ll open an issue on their repo.