From d30a105eb10c2f695bea03f4055a4086752cf149 Mon Sep 17 00:00:00 2001 From: Emilie Date: Fri, 14 Oct 2016 18:28:30 +0200 Subject: [PATCH] Install : update cron command --- install.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/install.py b/install.py index 18fc349d..78d7b91d 100755 --- a/install.py +++ b/install.py @@ -98,12 +98,11 @@ ExecStop=%s -f %s stop WantedBy=local.target """ - class DockerCompositionInstaller(object): docker = '/etc/init.d/docker' docker_compose = '/usr/local/bin/docker-compose' - cron_rule = "* */6 * * * %s %s" + cron_rule = "0 */6 * * * %s %s" def __init__(self, config='docker-compose.yml', init_type='sysvinit', cron=False, user=None): self.init_type = init_type @@ -156,10 +155,9 @@ class DockerCompositionInstaller(object): def install_cron(self): # version with migration - # command = "cd /srv/ircam-www && git pull origin dev && " + self.docker_compose + " -f " + self.config + " run app /srv/app/manage.py migrate --noinput && ./scripts/push.sh >> /var/log/cri/cron/`date +\%Y\%m\%d\%H\%M\%S`-cron.log 2>&1 \n" # without migration path = "PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin\n" - command = "cd /srv/ircam-www && ./scripts/push.sh >> /var/log/cri/cron/`date +\%Y\%m\%d-\%H-\%M-\%S`-cron.log 2>&1 \n" + command = "cd /srv/ircam-www && ./scripts/push.sh >> /var/log/cri/ircam-www-push.log 2>&1 \n" rule = self.cron_rule % (self.user, command) f = open('/etc/cron.d/' + self.name, 'w') f.write(path + rule) -- 2.39.5