syntax and var name corrections

This commit is contained in:
Asif Bacchus 2019-05-27 06:10:06 -06:00
parent 090ce7d7fb
commit f33f4824fa

View File

@ -12,7 +12,7 @@ warn=$(tput bold)$(tput setaf 3)
ok=$(tput setaf 2)
yellow=$(tput setaf 3)
cyan=$(tput setaf 6)
mag=$(tput setaf 5)
magenta=$(tput setaf 5)
### functions
@ -330,7 +330,7 @@ fi
### start logging
printf "${mag}[%s] --- Start %s execution ---${norm}\n" \
printf "${magenta}[%s] --- Start %s execution ---${norm}\n" \
"$(stamp)" "$scriptName" >> "$logFile"
printf "${cyan}[%s] -- [INFO] Log located at ${yellow}%s${cyan} --${norm}\n" \
"$(stamp)" "$logFile" >> "$logFile"
@ -432,7 +432,7 @@ elif [ ! -d "${borgBaseDir}" ]; then
badDetails dne 'borgBaseDir'
fi
printf "${magenta}details:borgBaseDir ${norm}-- ${ok}[OK]${norm}\n" \
>> "$logfile"
>> "$logFile"
export BORG_BASE_DIR="${borgBaseDir%/}"
## check path to SSH keyfile
@ -442,7 +442,7 @@ elif [ ! -d "${borgSSHKey}" ]; then
badDetails dne 'borgSSHKey'
fi
printf "${magenta}details:borgSSHKey ${norm}-- ${ok}[OK]${norm}\n" \
>> "$logfile"
>> "$logFile"
export BORG_RSH="ssh -i ${borgSSHKey}"
## check borg repo connect string
@ -450,13 +450,13 @@ if [ -z "${borgConnectRepo}" ]; then
badDetails empty 'borgConnectRepo'
fi
printf "${magenta}details:borgConnectRepo ${norm}-- ${ok}[OK]${norm}\n" \
>> "$logfile"
>> "$logFile"
export BORG_REPO="${borgConnectRepo}"
## check borg repo password
if [ -n "${borgRepoPassphrase}" ]; then
printf "${magenta}details:borgRepoPassphrase ${norm}-- ${ok}[OK]${norm}\n" \
>> "$logfile"
>> "$logFile"
export BORG_PASSPHRASE="${borgRepoPassphrase}"
else
# if passwd is blank intentionally, this is insecure
@ -489,7 +489,7 @@ if [ -n "${borgXtraListPath}" ]; then
$( sed -e '/^\s*#.*$/d' -e '/^\s*$/d' "${borgXtraListPath}" )
EOF
printf "${magenta}details:borgXtraListPath ${norm}-- ${ok}[OK]${norm}\n" \
>> "$logfile"
>> "$logFile"
includeXtra=1
fi
@ -578,7 +578,7 @@ fi
if [ -n "${borgPruneSettings}" ]; then
printf "${cyan}[%s] -- [INFO] Executing borg prune operation --${norm}\n" \
"$(stamp)" >> "$logFile"
borg prune --show-rc -v ${borgPruneParams} ${borgPruneSettings} \
borg prune --show-rc -v "${borgPruneParams}" "${borgPruneSettings}" \
2>> "$logFile"
borgPruneResult="$?"
else
@ -625,7 +625,7 @@ cleanup
# note complete success, tally warnings and exit
printf "${ok}[%s] -- [SUCCESS] All processes completed --${norm}\n" \
"$(stamp)" >> "$logFile"
printf "${mag}[%s] --- %s execution completed ---${norm}\n" \
printf "${magenta}[%s] --- %s execution completed ---${norm}\n" \
"$(stamp)" "$scriptName" >> "$logFile"
if [ "$warnCount" -gt 0 ]; then
printf "${warn}%s warnings issued!${norm}\n" "${warnCount}" >> "$logFile"