Browse Source

fixed bug

develop
Prabuddha Chakraborty 9 years ago
parent
commit
7f35a78d71
  1. 7
      ee/core/cron.py

7
ee/core/cron.py

@ -4,6 +4,7 @@ from ee.core.logging import Log
""" """
Set CRON on LINUX system. Set CRON on LINUX system.
https://pypi.python.org/pypi/python-crontab
""" """
class EECron(): class EECron():
@ -11,10 +12,12 @@ class EECron():
if not EEShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)): if not EEShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)):
tab = CronTab(user=user) tab = CronTab(user=user)
cron_job = tab.new(cmd, comment=comment) cron_job = tab.new(cmd, comment=comment)
cron_job.minute().on(min) cron_job.minute.on(min)
cron_job.hour().on(hour) cron_job.hour.on(hour)
#writes to crontab #writes to crontab
tab.write() tab.write()
Log.debug(self, "Cron is set:\n" + tab.render()) Log.debug(self, "Cron is set:\n" + tab.render())
else: else:
Log.debug(self, "Cron already exist") Log.debug(self, "Cron already exist")

Loading…
Cancel
Save