question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
moguIismcommented, 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.

0reactions
rokcarlcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cron job every hour at 30 minutes - Crontab.guru
The quick and simple editor for cron schedule expressions by Cronitor. “At minute 30 ... Cron job every hour at 30 minutes is...
Read more >
Need to schedule a job every hour in jenkins - Super User
Jenkins use cron expression as explained here. To schedule every hour, then you can put 0 * * * *. Then your job...
Read more >
How to Schedule a Python Code to Run Every Hour, Day ...
This video explains how to schedule a Python script to run every week, day, hour, minute or secondYou first import the schedule and...
Read more >
Controlling start time intervals in Scheduling
In Scheduling, click Availability. Click Global scheduling limits, then click Start time intervals. Select Automatically based on your ...
Read more >
How to schedule task for start of every hour - Stack Overflow
This is helpful but note that this code will run the task 1 minute and 1 second later than the beginning of an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found