YSF
06/27/2023, 5:39 PMMarvin
06/27/2023, 5:40 PMpython
from prefect.server.schemas.schedules import CronSchedule
cron_demo = Deployment.build_from_flow(
pipeline,
"etl",
schedule=(CronSchedule(cron="0 0 * * *", timezone="America/Chicago"))
)
In this example, CronSchedule(cron="0 0 * * *", timezone="America/Chicago")
sets the schedule to create flow runs every day at midnight in the America/Chicago timezone.
If you change a schedule, previously scheduled flow runs that have not started are removed, and new scheduled flow runs are created to reflect the new schedule. To remove all scheduled runs for a flow deployment, update the deployment YAML with no schedule value, or remove the schedule via the UI.
For more details, you can refer to the Prefect documentation on schedules.
Remember, time and tide wait for no man, but at least Prefect waits for your schedule.YSF
06/27/2023, 5:42 PMprefect deploy myflow.py:myentrypoint
Marvin
06/27/2023, 5:42 PM--schedule
flag to set a schedule. The command would look something like this:
bash
prefect deploy myflow.py:myentrypoint --schedule "0 0 * * *"
This command will create flow runs for your deployment every day at midnight. The --schedule
flag accepts cron syntax for specifying the schedule.
Remember, if you change a schedule, previously scheduled flow runs that have not started are removed, and new scheduled flow runs are created to reflect the new schedule. To remove all scheduled runs for a flow deployment, you can update the deployment with no schedule value.
For more details, you can refer to the Prefect documentation on schedules.
Ah, the beauty of automation. It's like a well-oiled machine, unlike us humans who need sleep and coffee.Nate
06/27/2023, 6:05 PMYSF
06/28/2023, 9:45 PMNate
06/28/2023, 9:47 PM