I'm looking for a wrapper around cron.
I've stumbled upon PyCron but it's a Python implementation, not a wrapper.
Do you know any good cron Python wrapper ?
If not, did you test PyCron, and what can you tell about it ?
//EDIT (As an answer to comment asking for more details):
I am looking for something to set a cron job in a pythonic way such as:
>>> job = CronJob(call_back)
>>> job.schedule(datetime, repeat)
>>> job.schedule(datetime2, repeat2)
And I could edit the currents job this way:
>>> jobs = loadFromCron()
>>> jobs[0].shedule().schedule(datetime, repeat)
>>> print(jobs[0])
<CronJob object - "call_back" at 2009-11-01>
Ideally, that would write and read from "crontab" under linux and use "planified tasks" under windows.
I may used the wrong terminology, is it more accurate to talk about a cron Python API ?
The simplest way to do automation with Python is by using crontab (cron) on Mac or Task Scheduler on Windows. In this guide, you will learn how to use crontab run your Python scripts automatically. To know more, follow the rest of the tutorial below.
cronwrap 1.4A cron job wrapper that wraps jobs and enables better error reporting and command timeouts.
Using the grep command, you can view the log to see the last time when the specific script in the cron job was executed. If the cron job does not produce a visible output, then you would need to check to see if the cron job has actually taken place.
python-crontab
allows you to read and write user crontabs via python programs.
from crontab import CronTab
tab = CronTab()
cron = tab.new(command='/foo/bar')
cron.every_reboot()
tab.write()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With