https://prefect.io logo
Title
l

Lucas Brum

01/27/2023, 3:16 PM
Hi! I hope it is well. I have a problem, I need rum a flow in the specifics days 1 of January and 25th of July, but I don't know how can organize a schedule for these 2 days, actually i'm use prefect 2.6.7 this work, but just for a 25 of July:
from prefect.orion.schemas.schedules import CronSchedule

schedule=CronSchedule(cron="0 0 25 6 *", timezone="America/Sao_Paulo"),
r

redsquare

01/27/2023, 3:27 PM
youll need rrule instead of cron https://docs.prefect.io/concepts/schedules/#rrule
:thank-you: 1
h

Hedgar

01/27/2023, 4:17 PM
Hi @redsquare I have similar challenge but mine is that I want to run at 10sec interval between say 10AM and 2pm every week day. Is it possible?
r

redsquare

01/27/2023, 4:19 PM
You can with bysetpos in rrule
l

Lucas Brum

01/27/2023, 5:27 PM
Thanks for anwering me! This is correct im my case @redsquare?
from prefect.orion.schemas.schedules import RRuleSchedule

    schedule=RRuleSchedule(rrule="FREQ=YEARLY;INTERVAL=1;BYMONTH=1,6;BYMONTHDAY=1,25", timezone="America/Sao_Paulo"),
r

redsquare

01/27/2023, 5:35 PM
It looks fine - you can test the rule here https://jakubroztocil.github.io/rrule/
image.png
ah wait - its doing 1 & 25th of both
youll need to mess around with rruleset i think
l

Lucas Brum

01/27/2023, 7:23 PM
Where can i read about this?