From 6b954e98f951bd4338208a29df0b59385bc1fc43 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 11 Feb 2020 15:32:40 +0100 Subject: [PATCH] Merge cron into scripts folder --- bin/voicegardens-cron-daily | 4 ++++ cron/voicegardens | 7 ------- fabfile.py | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) create mode 100755 bin/voicegardens-cron-daily delete mode 100755 cron/voicegardens diff --git a/bin/voicegardens-cron-daily b/bin/voicegardens-cron-daily new file mode 100755 index 0000000..50ba6a5 --- /dev/null +++ b/bin/voicegardens-cron-daily @@ -0,0 +1,4 @@ +#!/bin/sh + +/var/www/doesitsparkjoy.voicegardens.org/bin/clear-archives | tee -a /var/log/voicegardens.org.log +/var/www/doesitsparkjoy.voicegardens.org/bin/copy-fixed-archive | tee -a /var/log/voicegardens.org.log diff --git a/cron/voicegardens b/cron/voicegardens deleted file mode 100755 index dd5f5f7..0000000 --- a/cron/voicegardens +++ /dev/null @@ -1,7 +0,0 @@ -SHELL=/bin/bash - -# every morning at 09:00, clear the archives -0 9 * * * /var/www/doesitsparkjoy.voicegardens.org/bin/clear-archives | tee -a /var/log/voicegardens.org.log - -# every morning at 09:01, copy over the fixed archive -1 9 * * * /var/www/doesitsparkjoy.voicegardens.org/bin/copy-fixed-archive | tee -a /var/log/voicegardens.org.log diff --git a/fabfile.py b/fabfile.py index 1e49f0a..290399e 100644 --- a/fabfile.py +++ b/fabfile.py @@ -31,9 +31,9 @@ def dailycron(c): """Copy new crontab.""" print('Copy over new crontab ...') # See https://github.com/fabric/fabric/issues/1750 - c.put('./cron/voicegardens', remote='./') + c.put('./bin/voicegardens-cron-daily', remote='./') c.sudo('mv voicegardens /etc/cron.daily') - c.sudo('chown root:root /etc/cron.daily/voicegardens') + c.sudo('chown root:root /etc/cron.daily/voicegardens-cron-daily') print('New cron in place <3') @task