From d602b11979be7dc6cdc36cbe020ef7f0e902d31e Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Sat, 13 Mar 2021 20:17:33 +0100 Subject: [PATCH] [IMP]RsyncVolumes : optional hourly rsync --- backups/rsyncvolumes/launch.c7.sh | 4 ++++ backups/rsyncvolumes/launch.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/backups/rsyncvolumes/launch.c7.sh b/backups/rsyncvolumes/launch.c7.sh index e14ccb0..9831012 100644 --- a/backups/rsyncvolumes/launch.c7.sh +++ b/backups/rsyncvolumes/launch.c7.sh @@ -2,4 +2,8 @@ printenv >> /etc/environment envsubst < /opt/backup/rsync.template > /opt/backup/rsync.sh +if [ "$NO_RSYNC" == 1 ]; then + sed -i '/rsync.sh/d' ./crontab + rm /opt/backup/rsync.* +fi crontab ./crontab && touch /var/log/cron.log && crond && tail -f /var/log/cron.log diff --git a/backups/rsyncvolumes/launch.sh b/backups/rsyncvolumes/launch.sh index b346039..6a200fc 100644 --- a/backups/rsyncvolumes/launch.sh +++ b/backups/rsyncvolumes/launch.sh @@ -2,4 +2,8 @@ printenv >> /etc/environment envsubst < /opt/backup/rsync.template > /opt/backup/rsync.sh +if [ "$NO_RSYNC" == 1 ]; then + sed -i '/rsync.sh/d' ./crontab + rm /opt/backup/rsync.* +fi crontab ./crontab && touch /var/log/cron.log && cron && tail -f /var/log/cron.log