From 1e3ef9a302cdfdb0fa4b646ab558434deecfec91 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 20 Oct 2018 05:06:49 -0600 Subject: [PATCH] Set vars with docker volume locations --- root/scripts/backup.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/root/scripts/backup.sh b/root/scripts/backup.sh index 4f64844..aee2c3c 100644 --- a/root/scripts/backup.sh +++ b/root/scripts/backup.sh @@ -231,6 +231,11 @@ unset BORG_REPO unset BORG_PASSPHRASE unset BORG_REMOTE_PATH unset TMPDIR +unset dockerVolumeMail +unset dockerVolumeRspamd +unset dockerVolumePostfix +unset dockerVolumeRedis +unset dockerVolumeCrypt exitError=() errorExplain=() exitWarn=() @@ -668,6 +673,14 @@ fi export TMPDIR="${BORG_BASE_DIR}/tmp" +## Get docker volume paths on filesystem for inclusion in backup +dockerVolumeMail=$(docker volume inspect -f '{{ .Mountpoint }}' ${COMPOSE_PROJECT_NAME}_vmail-vol-1) +dockerVolumeRspamd=$(docker volume inspect -f '{{ .Mountpoint }}' ${COMPOSE_PROJECT_NAME}_rspamd-vol-1) +dockerVolumePostfix=$(docker volume inspect -f '{{ .Mountpoint }}' ${COMPOSE_PROJECT_NAME}_postfix-vol-1) +dockerVolumeRedis=$(docker volume inspect -f '{{ .Mountpoint }}' ${COMPOSE_PROJECT_NAME}_redis-vol-1) +dockerVolumeCrypt=$(docker volume inspect -f '{{ .Mountpoint }}' ${COMPOSE_PROJECT_NAME}_crypt-vol-1) + + ## Generate and execute borg # commandline depends on whether borgExclude is empty or not if [ -z "$borgExclude" ]; then