From a57c9f6f41f139c95fb1fea1748a6a98665b8adb Mon Sep 17 00:00:00 2001 From: Ignacio Nunez Date: Tue, 15 May 2018 05:20:06 +0200 Subject: [PATCH] nc-update-netcloud: include version in backup name --- bin/ncp-update-nc | 11 +++++------ changelog.md | 6 ++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index cb737c3c3..413da12d9 100644 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -66,7 +66,6 @@ cleanup() { set +eE echo "Clean up..." rm -rf /var/www/nextcloud.tar.bz2 /var/www/nextcloud-old - sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off trap "" EXIT exit $RET } @@ -85,17 +84,17 @@ WITH_DATA=no COMPRESSED=yes LIMIT=0 -sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on - echo "Back up current instance..." set +eE ncp-backup "$BKPDIR" "$WITH_DATA" "$COMPRESSED" "$LIMIT" # && false # test point RET=$? set -eE -BKP="$( ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )" -[[ -f "$BKP" ]] || { set +eE; echo "Error backing up"; false || cleanup; } -[[ $RET -ne 0 ]] && { rm -f "$BKP"; set +eE; echo "Error backing up"; false || cleanup; } +BKP_="$( ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )" +[[ -f "$BKP_" ]] || { set +eE; echo "Error backing up"; false || cleanup; } +[[ $RET -ne 0 ]] && { rm -f "$BKP_"; set +eE; echo "Error backing up"; false || cleanup; } +BKP="$( dirname "$BKP_" )/$( basename "$BKP_" .tar.gz )-${CURRENT}.tar.gz" +mv "$BKP_" "$BKP" # simple restore if anything fails from here #################### diff --git a/changelog.md b/changelog.md index 41cf77ddf..c9baec719 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,9 @@ -[v0.55.3](https://github.com/nextcloud/nextcloudpi/commit/1c093f2) (2018-05-15) nc-backup: faster free space calculation. Minimize maintenance mode time +[v0.55.4](https://github.com/nextcloud/nextcloudpi/commit/855a996) (2018-05-15) nc-update-netcloud: include version in backup name -[v0.55.2](https://github.com/nextcloud/nextcloudpi/commit/2ab49f4) (2018-05-14) nc-datadir: fix php cli tmpdir +[v0.55.3](https://github.com/nextcloud/nextcloudpi/commit/585518a) (2018-05-15) nc-backup: faster free space calculation. Minimize maintenance mode time + +[v0.55.2, master](https://github.com/nextcloud/nextcloudpi/commit/2ab49f4) (2018-05-14) nc-datadir: fix php cli tmpdir [v0.55.1 ](https://github.com/nextcloud/nextcloudpi/commit/a0a1145) (2018-05-14) nc-backup: exclude ncp-update-nc backups