From 59290a1011b1db06df3ca5ca3f760cb5a9f0cbb9 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sun, 14 Oct 2018 06:50:42 -0600 Subject: [PATCH] Added borg execution section --- backup.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index f5ec5ea..22780ba 100755 --- a/backup.sh +++ b/backup.sh @@ -504,7 +504,24 @@ if [ -n "$borgXtra" ]; then fi fi - +## Generate and execute borg +# commandline depends on whether borgExclude is empty or not +if [ -z "$borgExclude" ]; then + # borgExclude is empty + echo -e "${op}${stamp} Executing borg without exclusions${normal}" \ + >> "$logFile" + borg --show-rc create ${borgCreateParams} :: `date +%Y-%m-%d_%H%M%S` \ + "${xtraFiles[@]}" \ + "${sqlDumpDir}" "${ncDataDir}" +else + # borgExclude is not empty + echo -e "${op}${stamp} Executing borg with exclusions${normal}" \ + >> "$logFile" + borg --show-rc create ${borgCreateParams} --exclude-from "${borgExclude}" \ + :: `date +%Y-%m-%d_%H%M%S` \ + "${xtraFiles[@]}" \ + "${sqlDumpDir}" "${ncDataDir}" +fi ### Exit NextCloud maintenance mode