Schedule
Represents a schedule for batch jobs.
__init__(cron_expression='', at_minutes=None, every_minute=None, at_hours=None, every_hour=None, weekdays=None, day_of_month=None, in_month=None, every_month=None, timezone=None, run_after_job_uuid=None, run_after_job_name=None, run_after_job_condition=None)
Initialize a Schedule.
You can either provide a raw cron_expression or use the human-readable helper parameters (which are compiled into cron syntax automatically).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cron_expression
|
str
|
A raw cron string (e.g. |
''
|
at_minutes
|
list[int] | None
|
Specific minutes past the hour to run
(e.g. |
None
|
every_minute
|
int | None
|
Run every N minutes (e.g. |
None
|
at_hours
|
list[int] | None
|
Specific hours of the day to run (0 -- 23). |
None
|
every_hour
|
int | None
|
Run every N hours. |
None
|
weekdays
|
list[str] | None
|
Days of the week to run
(e.g. |
None
|
day_of_month
|
int | None
|
Day of the month to run (1 -- 31). |
None
|
in_month
|
list[str] | None
|
Months to run in
(e.g. |
None
|
every_month
|
int | None
|
Run every N months. |
None
|
timezone
|
str | None
|
IANA timezone name (e.g. |
None
|
run_after_job_uuid
|
str | None
|
UUID of a job that must complete before this schedule triggers. |
None
|
run_after_job_name
|
str | None
|
Name of a job that must complete before this schedule triggers. |
None
|
run_after_job_condition
|
str | None
|
Required completion status of the
predecessor job (e.g. |
None
|
Example
from datatailr import Schedule
# Every weekday at 08:00 and 16:00 UTC
s = Schedule(at_hours=[8, 16], weekdays=["mon","tue","wed","thu","fri"])
get_cron_string()
Returns the compiled cron string.