Merge pull request #53 from jeromelebleu/dev

Fix cron job schedule for monitoring
This commit is contained in:
Jérôme Lebleu 2013-12-17 09:40:10 -08:00
commit 6cc529b21e

View file

@ -360,9 +360,10 @@ def monitor_enable(no_stats=False):
# Install crontab
if not no_stats:
cmd = 'yunohost monitor update-stats'
# day: every 5 min # week: every 1 h # month: every 4 h #
rules = ('*/5 * * * * root %(cmd)s day --no-ldap >> /dev/null\n' + \
'0 * * * * root %(cmd)s week --no-ldap >> /dev/null\n' + \
'* */4 * * * root %(cmd)s month --no-ldap >> /dev/null') % {'cmd': cmd}
'0 */4 * * * root %(cmd)s month --no-ldap >> /dev/null') % {'cmd': cmd}
os.system("touch %s" % crontab_path)
os.system("echo '%s' >%s" % (rules, crontab_path))