Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I setup a schedule for exact minute of every hour? #144

Open
mickey9801 opened this issue Jun 13, 2017 · 6 comments
Open

How can I setup a schedule for exact minute of every hour? #144

mickey9801 opened this issue Jun 13, 2017 · 6 comments

Comments

@mickey9801
Copy link

mickey9801 commented Jun 13, 2017

I have setup a raspberry pi for read temperature and humidity from sensor and I would like it to publish those data to a MQTT broker at 00,15,30,45 minute of every hour, like weather report of observatory . How can I setup this schedule?

I have setup a schedule like this: schedule.every(15).minutes.do(read_n_publish) but it can only run the job every 15 minute from the time I start run the program.

@cparrish60
Copy link

I have a similar requirement.

@onesuper
Copy link

+1

@grandimam
Copy link

grandimam commented Jul 18, 2017

@mickey9801 This is really simple.

The whole schedule package implementation is sequential. And, you could solve the problem like this.
`schedule.every(15).minutes.do(read_n_publish)
schedule.every(30).minutes.do(read_n_publish)
schedule.every(45).minutes.do(read_n_publish)

while True:
schedule.run_pending()
time.sleep(1)`

What this will do is it will run the code every 15, 30, 45 minutes.

@dbader
Copy link
Owner

dbader commented Jul 25, 2017

Some work on that happening here: #116

@Nilpo
Copy link

Nilpo commented Jul 27, 2017

@fauzanm You would only need to schedule every(15). Yours would result in stacking. It would also be contingent upon the script being started at exactly minute 00.

@rokcarl
Copy link

rokcarl commented Jul 9, 2018

Exactly, so the @fauzanbaigm solution wouldn't work correctly, i.e. it wouldn't run at exactly e.g. 12:30, but it would run at e.g. 12:38.

I need this functionality as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants