dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.62k stars 954 forks source link

How do I schedule a job that starts at minute 5 and runs every 10 minutes #590

Open ponders opened 1 year ago

ponders commented 1 year ago

documentation suggests schedule.every(10).minutes.at("05:00") but schedule whines that "Invalid time format for a minutely job (valid format is :SS)". I tried changing to at(":300") (five minutes as seconds) but that also doesn't match the required format either.

aquib-sh commented 1 year ago

@ponders Did you try time.sleep for 5 mins and then schedule the job every 10 mins? What you want is to start the job after 5 mins and then it must run every 10 mins if I understood your question correctly

mohana-martin commented 10 months ago

@aquib-sh That completely defeats the purpose of using a scheduler.. Might aswell sleep for every 10 minutes.

@ponders I believe you could follow/combine the examples: Run a job once and Run a job every x minutes, where the first job runs in 5 minutes and schedules the actual "every-10-minute" job. Hope it helps!