You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cron expressions such as "0 0 1-7 * 4" (first thursday of every month) is not supported by your library.
The error is caused by these code:
if not matchers.day.any:
_assert(matchers.weekday.any,
"missing a wildcard specifier for weekday")
if not matchers.weekday.any:
_assert(matchers.day.any,
"missing a wildcard specifier for day")
in the CronTab._make_matchers method.
The text was updated successfully, but these errors were encountered:
Wouldn't "0 0 1-7 * 4" mean days 1-7 and also any Thursdays? The wikipedia page given in the parse-crontab README instead mentions the # symbol for expressions such as "the first Thursday".
The crontab(5) manual on my system says:
Note: The day of a command's execution can be specified in the following two fields — 'day of month', and 'day of week'. If both fields are restricted (i.e., do not contain the "*" character), the command will be run when either field matches the current time. For example, "30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
As @grahambell mentioned, the '#' specifier is supposed to handle that behavior, but this module explicitly excludes that functionality. And as @grahambell quoted, when both day of month and week are restricted, cron expressions don't work the way you would expect.
To address this limitation, I would suggest using the "0 0 1-7 * *" variant, then verifying upon trigger that the date/time is on the day of week that you want. I do a similar thing to handle timezones and DST changes in my own code that uses this package.
Cron expressions such as "0 0 1-7 * 4" (first thursday of every month) is not supported by your library.
The error is caused by these code:
in the CronTab._make_matchers method.
The text was updated successfully, but these errors were encountered: