<@ULVA73B9P> explain the "day_or" part of a cron s...
# ask-marvin
k
@Marvin explain the "day_or" part of a cron schedule config
m
In a cron schedule configuration, the
day_or
parameter determines how the day of the month and the day of the week entries are combined. - When
day_or
is set to
True
: The schedule runs a flow if either the specified day of the month or the specified day of the week matches. It acts like an OR condition. For example, a cron schedule like
* * 3 1 2
would run every minute on the third day of the month and on every Tuesday in January. - When
day_or
is set to
False
: The schedule requires both the day of the month and the day of the week to match, similar to an AND condition. This means the flow would run only on the third Tuesday in January. This functionality can be particularly useful when you need flexible scheduling options. For more details, you can check the Prefect documentation on scheduling.
k
@Marvin when will this schedule be triggered: schedules: - cron: 0 11 2 * * timezone: UTC day_or: true active: true
m
Given the provided cron schedule configuration: - Cron Expression:
0 11 2 * *
- Timezone: UTC - Day Or: True This schedule will trigger at 11:00 AM UTC on the 2nd day of every month. Since
day_or
is set to
True
, the schedule would also trigger if there was a day of the week specified, but in this case, only the day of the month is specified. Therefore, it will run on the 2nd of each month at 11:00 AM UTC.
k
@Marvin what about this one? schedules: - cron: 0 9 * * * timezone: UTC day_or: true active: true
m
For the provided cron schedule configuration: - Cron Expression:
0 9 * * *
- Timezone: UTC - Day Or: True This schedule will trigger every day at 9:00 AM UTC. The
day_or
setting is irrelevant here because there are no specific day of the month or day of the week conditions specified in the cron expression. It simply runs daily at the specified time.