Python script works but does not actually update cron. crontab -u -l shows no changes even though code ran without error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-crontab |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Python script works but does not actually update cron. crontab -u -l shows no changes even though code ran without error
from crontab import CronTab
import sys
# Create a new non-installed crontab
cron = CronTab(
job = cron.new(
job.minute.
job.hour.every(4)
job.dow.on('SUN')
job.month.
job.month.
job.every(2).days()
job.setall(1, 12, None, None, None)
job.enable()
job2 = cron.new(
job2.every_reboot()
jobs = list(cron.
job3 = jobs[0]
job3.clear()
job3.minute.
sys.stdout.
This works as expected but when I perform crontab -l -u aroth it is blank.
Same thing when I remove a job I don't see it in the render but it is still there when I type crontab -u aroth -l
Is it writing to a different file?
Thanks
Changed in python-crontab: | |
status: | New → Invalid |
Try cron.write() before you exit.