From ba5885dd369e938edb8520e10581fcd3183eb75b Mon Sep 17 00:00:00 2001 From: Tobias Strobel Date: Thu, 30 Sep 2021 09:53:30 +0200 Subject: [PATCH] Ensure nextcloud backup path exists --- helios/external-backup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helios/external-backup.sh b/helios/external-backup.sh index 095cb02..127b4cc 100644 --- a/helios/external-backup.sh +++ b/helios/external-backup.sh @@ -183,6 +183,7 @@ backupNC () { NCOCC="sudo -u www-data php $NCDIR/occ" NCDATADIR="$($NCOCC config:system:get datadirectory)" NCDUMPSDIR="$NCDATADIR/sqldumps" + NCBKPPATH="$DATA_PATH/"$SERVER"/daily.0$NCDATADIR" DBPASSWORD="$($NCOCC config:system:get dbpassword)" DBNAME="$($NCOCC config:system:get dbname)" DBHOST="$($NCOCC config:system:get dbhost)" @@ -206,7 +207,8 @@ backupNC () { echo "Backup $NCDATADIR" - rsync -aAXHh --stats --numeric-ids --noatime --delete --delete-excluded $NCDATADIR/ $DATA_PATH/"$SERVER"/daily.0$NCDATADIR + mkdir -p $NCBKPPATH + rsync -aAXHh --stats --numeric-ids --noatime --delete --delete-excluded $NCDATADIR/ $NCBKPPATH STATUSCODE=$?