The @reboot seems to be a reference to the crontab files' syntax, not python syntax. Looking in crontab.py, there is a method
every_reboot()
that could work for you. The docstring of crontab.py shows examples, some involving every_reboot():
from crontab import CronTab
import sys
# Create a new non-installed crontab
cron = CronTab(tab='')
job = cron.new(command='/usr/bin/echo')
job.minute.during(5,50).every(5)
job.hour.every(4)
job.dow.on('SUN')
job.month.during('APR', 'JUN')
job.month.also.during('OCT', 'DEC')
job.every(2).days()
job.setall(1, 12, None, None, None)
job2 = cron.new(command='/foo/bar', comment='SomeID')
job2.every_reboot()
jobs = list(cron.find_command('bar'))
job3 = jobs[0]
job3.clear()
job3.minute.every(1)
sys.stdout.write(str(cron.render()))
job3.enable(False)
for job4 in cron.find_command('echo'):
sys.stdout.write(job4)
for job5 in cron.find_comment('SomeID'):
sys.stdout.write(job5)
for job6 in cron:
sys.stdout.write(job6)
for job7 in cron:
job7.every(3).hours()
sys.stdout.write(job7)
job7.every().dow()
cron.remove_all(command='/foo/bar')
cron.remove_all(comment='This command')
cron.remove_all(time='* * * * *')
cron.remove_all()
output = cron.render()
cron.write()
cron.write(filename='/tmp/output.txt')
#cron.write_to_user(user=True)
#cron.write_to_user(user='root')
# Croniter Extentions allow you to ask for the scheduled job times, make
# sure you have croniter installed, it's not a hard dependancy.
job3.schedule().get_next()
job3.schedule().get_prev()