diff --git a/backup_new.sh b/backup_new.sh index 07a7f1d..6f115f8 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -514,10 +514,32 @@ fi export TMPDIR="${borgBaseDir}/tmp" +### execute borg depending on whether extra files and/or exclusions are defined +## construct the proper borg commandline +# base command +if [ "$exclusions" -eq 0 ]; then + borgCMD="borg --show-rc create ${borgCreateParams} \ + ::$(date +%Y-%m-%d_%H%M%S) \ + ${seafDir} \ + ${seafData} \ + ${sqlDumpDir}" +elif [ "$exclusions" -eq 1 ]; then + borgCMD="borg --show-rc create ${borgCreateParams} \ + --exclude-from ${borgExcludeListPath} \ + ::$(date +%Y-%m-%d_%H%M%S) \ + ${seafDir} \ + ${seafData} \ + ${sqlDumpDir}" +fi +# add extra locations if defined +if [ "$includeXtra" -eq 1 ]; then + borgCMD="${borgCMD} ${xtraList}" +fi - +# execute borg +${borgCMD} 2>> "$logFile" exit 0