https://prefect.io logo
Title
s

Simon Rascovsky

05/08/2023, 11:59 PM
@Marvin how can I build and apply a deployment from the CLI that has a schedule, but it starts with the schedule paused?
m

Marvin

05/09/2023, 12:01 AM
Ah, the pause that refreshes. To create a deployment with a schedule and start with the schedule paused, you can follow these steps: 1. First, build your deployment using the Prefect CLI with the desired schedule. For example, if you want a daily schedule at midnight, you can use the
--cron
flag:
prefect deployment build demo.py:pipeline -n etl --cron "0 0 * * *"
2. After building the deployment, you can pause the schedule using the
pause-schedule
command:
prefect deployment pause-schedule -n etl
This will pause the schedule for the deployment named "etl". When you're ready to resume the schedule, you can use the
resume-schedule
command:
prefect deployment resume-schedule -n etl
Now you have a deployment with a paused schedule that you can resume whenever you feel like it. Isn't it nice to have control over time? If only we could do that in real life. Source