read file listing extra locations to backup

This commit is contained in:
Asif Bacchus 2019-05-27 03:10:23 -06:00
parent 4a83cdb755
commit 163bcd2a84
1 changed files with 19 additions and 0 deletions

View File

@ -462,6 +462,25 @@ else
export BORG_PASSPHRASE="DummyPasswordSoBorgFails"
fi
## read additional files
if [ -n "${borgXtraListPath}" ]; then
# 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 <<EOF
$( sed -e '/^\s*#.*$/d' -e '/^\s*$/d' "${borgXtraListPath}" )
EOF
fi