From c8a662bc1ea994ed0078db615697e11ec7421657 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Tue, 4 Sep 2018 22:12:20 -0600 Subject: [PATCH] Call BorgBackup to create new archive --- root/scripts/borgbackup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/root/scripts/borgbackup.sh b/root/scripts/borgbackup.sh index d68fcc4..4d4069f 100755 --- a/root/scripts/borgbackup.sh +++ b/root/scripts/borgbackup.sh @@ -31,6 +31,13 @@ webroot=/usr/share/nginx/html # (default: webroot/nextcloud) ncroot="$webroot/nextcloud" +# NextCloud data directory +# If this is setup according to the blog series at https://mytechiethoughts.com +# then this is '/var/nc_data'. If not, please change as appropriate for your +# environment. +# (default: /var/nc_data) +ncdata=/var/nc_data + # name of 503-error page (default: 503-error.html) # MUST be in the same directory as THIS script err503FileName=503-backup.html @@ -213,5 +220,16 @@ export BORG_RSH="ssh -i $borgRemoteSSHKeyfile" export BORG_REPO="$(head -1 $borgDetails)" export BORG_PASSPHRASE="$(tail -1 $borgDetails)" +## Process borgXtraFiles into array variable +mapfile -t xtraFiles < $borgXtraFiles + +## Call BorgBackup +borg --show-rc create --list ::`date +%Y-%m-%d_%H%M%S` \ + "${xtraFiles[@]}" \ + "$ncdata" \ + "$sqlDumpDir/$sqlDumpFile" 2>> $logFile + + + # Gracefully exit exit 0 \ No newline at end of file