From 8486c4b7d2e2b5dd10cf84a2b7643aab25b09caa Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 7 May 2020 04:58:26 -0600 Subject: [PATCH] make xtraList optional --- backup/backup.sh | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/backup/backup.sh b/backup/backup.sh index d3f6dde..b8b0257 100755 --- a/backup/backup.sh +++ b/backup/backup.sh @@ -469,28 +469,6 @@ printf "%s[%s] -- [INFO] %s%s%s imported --%s\n" \ printf "%s[%s] -- [INFO] Verifying supplied borg details --%s\n" \ "$cyan" "$(stamp)" "$norm" >> "$logFile" -## read additional files -- this is required otherwise nothing to backup! -if [ -z "${borgXtraListPath}" ]; then - badDetails empty 'xtraLocations' -else - # check if file actually exists - if [ ! -f "${borgXtraListPath}" ]; then - badDetails dne 'borgXtraListPath' - fi - # read file contents into concatenated list for echo to cmdline - while read -r xtraItem; do - if [ -z "${xtraList}" ]; then - xtraList="${xtraItem}" - else - xtraList="${xtraList} ${xtraItem}" - fi - done <> "$logFile" -fi - ## verify borg base directory if [ -z "${borgBaseDir}" ]; then badDetails empty 'borgBaseDir' @@ -559,6 +537,28 @@ if [ -n "${borgExcludeListPath}" ]; then exclusions=1 fi +## read additional files +if [ -z "${borgXtraListPath}" ]; then + xtraList='' +else + # check if file actually exists + if [ ! -f "${borgXtraListPath}" ]; then + badDetails dne 'borgXtraListPath' + fi + # read file contents into concatenated list for echo to cmdline + while read -r xtraItem; do + if [ -z "${xtraList}" ]; then + xtraList="${xtraItem}" + else + xtraList="${xtraList} ${xtraItem}" + fi + done <> "$logFile" +fi + ### set location of sql dump # this is done before resetting default TMP dir for borg