Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2018-07-25 14:36:08 +0300
committernachoparker <nacho@ownyourbits.com>2018-07-25 14:36:23 +0300
commitdad9900740637f30137f531d162a7dbdcade2803 (patch)
treec00ee16eb3753f3f913d194fdb48e48a9f4b56c1
parent7486d66101fed8f57ed1518b629175a3a5aa8a2f (diff)
nc-datadir: backup existing datadir after checksv0.58.1
-rw-r--r--changelog.md4
-rw-r--r--etc/ncp-config.d/nc-datadir.sh16
2 files changed, 12 insertions, 8 deletions
diff --git a/changelog.md b/changelog.md
index c920cca7..25f483a9 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,7 @@
-[v0.58.0](https://github.com/nextcloud/nextcloudpi/commit/4c53bf3) (2018-07-23) update to NC 13.0.5
+[v0.58.1](https://github.com/nextcloud/nextcloudpi/commit/422f4b7) (2018-07-25) nc-datadir: backup existing datadir after checks
+
+[v0.58.0](https://github.com/nextcloud/nextcloudpi/commit/60cfc18) (2018-07-23) update to NC 13.0.5
[v0.57.21](https://github.com/nextcloud/nextcloudpi/commit/214c187) (2018-07-23) Fixes #566 Remove redundant opcache configuration (#572)
diff --git a/etc/ncp-config.d/nc-datadir.sh b/etc/ncp-config.d/nc-datadir.sh
index da5059ae..38f0e05f 100644
--- a/etc/ncp-config.d/nc-datadir.sh
+++ b/etc/ncp-config.d/nc-datadir.sh
@@ -39,13 +39,7 @@ configure()
[[ "$SRCDIR" == "$DATADIR_" ]] && { echo -e "INFO: data already there"; return 0; }
- # check datadir exists
- [ -d $DATADIR_ ] && {
- local BKP="${DATADIR_}-$( date "+%m-%d-%y" )"
- echo "INFO: $DATADIR_ is not empty. Creating backup $BKP"
- mv "$DATADIR_" "$BKP"
- }
-
+ # checks
local BASEDIR=$( dirname "$DATADIR_" )
[ -d "$BASEDIR" ] || { echo "$BASEDIR does not exist"; return 1; }
@@ -59,6 +53,14 @@ configure()
return 1
}
+ # backup possibly existing datadir
+ [ -d $DATADIR_ ] && {
+ local BKP="${DATADIR_}-$( date "+%m-%d-%y" )"
+ echo "INFO: $DATADIR_ is not empty. Creating backup $BKP"
+ mv "$DATADIR_" "$BKP"
+ }
+
+
## COPY
cd /var/www/nextcloud
sudo -u www-data php occ maintenance:mode --on