Ensure nextcloud backup path exists

This commit is contained in:
Tobias Strobel 2021-09-30 09:53:30 +02:00
parent eba6edff6c
commit ba5885dd36

View file

@ -183,6 +183,7 @@ backupNC () {
NCOCC="sudo -u www-data php $NCDIR/occ" NCOCC="sudo -u www-data php $NCDIR/occ"
NCDATADIR="$($NCOCC config:system:get datadirectory)" NCDATADIR="$($NCOCC config:system:get datadirectory)"
NCDUMPSDIR="$NCDATADIR/sqldumps" NCDUMPSDIR="$NCDATADIR/sqldumps"
NCBKPPATH="$DATA_PATH/"$SERVER"/daily.0$NCDATADIR"
DBPASSWORD="$($NCOCC config:system:get dbpassword)" DBPASSWORD="$($NCOCC config:system:get dbpassword)"
DBNAME="$($NCOCC config:system:get dbname)" DBNAME="$($NCOCC config:system:get dbname)"
DBHOST="$($NCOCC config:system:get dbhost)" DBHOST="$($NCOCC config:system:get dbhost)"
@ -206,7 +207,8 @@ backupNC () {
echo "Backup $NCDATADIR" 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=$? STATUSCODE=$?