I tried to run my python scripts using crontab. As the amount of my python scripts accumulates, it is hard to manage in crontab.
Then I tries two python schedule task libraries named Advanced Python Scheduler and schedule.
The two libraries are quite the same in use, for example:
import schedule
import time
def job():
print("I'm working...")
schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at("10:30").do(job)
while True:
schedule.run_pending()
time.sleep(1)
The library uses the time
module to wait until the exact moment to execute the task.
But the script has to run all the time and consumes tens of Megabytes memory. So I want to ask it is a better way to handle schedule jobs using the library? Thanks.