From 390b313025705e2817dd73970d078d13c1352949 Mon Sep 17 00:00:00 2001 From: nachoparker Date: Thu, 10 Aug 2017 01:02:11 +0200 Subject: nc-restore: dont destroy existing datadir --- etc/nextcloudpi-config.d/nc-restore.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/nextcloudpi-config.d/nc-restore.sh b/etc/nextcloudpi-config.d/nc-restore.sh index 5b320303..071a2f52 100644 --- a/etc/nextcloudpi-config.d/nc-restore.sh +++ b/etc/nextcloudpi-config.d/nc-restore.sh @@ -80,7 +80,7 @@ EOF local DATADIR=$( grep datadirectory $BASEDIR/nextcloud/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 ) [[ "$DATADIR" == "" ]] && { echo -e "Error reading data directory"; return 1; } echo -e "restore datadir to $DATADIR..." - rm -rf "$DATADIR" + test -e "$DATADIR" && mv "$DATADIR" "$DATADIR-$( date "+%m-%d-%y" )" mkdir -p "$( dirname "$DATADIR" )" mv "$TMPDIR/$( basename "$DATADIR" )" "$DATADIR" sudo -u www-data php occ maintenance:mode --off -- cgit v1.2.3