views:

253

answers:

1

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 ?

+3  A: 

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()
J.F. Sebastian