Cron
Cron-based automation schedule for use with Trigger.
Attributes
| Attribute | Type | Description |
|---|---|---|
| expression | str | Cron expression string (e.g., "0 * * * *"). |
| timezone | Timezone = UTC | Timezone for the cron schedule (default "UTC"). One of the standard timezone values (e.g., "US/Eastern", "Europe/London"). Note that DST transitions may cause skipped or duplicated runs. |
Constructor
Signature
def Cron(
expression: str,
timezone: Timezone = "UTC"
)
Parameters
| Name | Type | Description |
|---|---|---|
| expression | str | Cron expression string (e.g., "0 * * * *"). |
| timezone | Timezone = "UTC" | Timezone for the cron schedule (default "UTC"). One of the |
standard timezone values (e.g., `"US/Eastern"`, `"Europe/London"`).
Note that DST transitions may cause skipped or duplicated runs. |
Methods
timezone_expression()
@classmethod
def timezone_expression() - > str
Constructs and returns the cron expression prefixed with the timezone setting. This formatted string is suitable for use in systems that support the CRON_TZ environment variable.
Returns
| Type | Description |
|---|---|
str | The cron expression string including the timezone prefix (e.g., "CRON_TZ=UTC 0 * * * *"). |