Skip to content

Commit a57c9f6

Browse files
committed
nc-update-netcloud: include version in backup name
1 parent e36a214 commit a57c9f6

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

bin/ncp-update-nc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ cleanup() {
6666
set +eE
6767
echo "Clean up..."
6868
rm -rf /var/www/nextcloud.tar.bz2 /var/www/nextcloud-old
69-
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off
7069
trap "" EXIT
7170
exit $RET
7271
}
@@ -85,17 +84,17 @@ WITH_DATA=no
8584
COMPRESSED=yes
8685
LIMIT=0
8786

88-
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
89-
9087
echo "Back up current instance..."
9188
set +eE
9289
ncp-backup "$BKPDIR" "$WITH_DATA" "$COMPRESSED" "$LIMIT" # && false # test point
9390
RET=$?
9491
set -eE
9592

96-
BKP="$( ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
97-
[[ -f "$BKP" ]] || { set +eE; echo "Error backing up"; false || cleanup; }
98-
[[ $RET -ne 0 ]] && { rm -f "$BKP"; set +eE; echo "Error backing up"; false || cleanup; }
93+
BKP_="$( ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null | head -1 )"
94+
[[ -f "$BKP_" ]] || { set +eE; echo "Error backing up"; false || cleanup; }
95+
[[ $RET -ne 0 ]] && { rm -f "$BKP_"; set +eE; echo "Error backing up"; false || cleanup; }
96+
BKP="$( dirname "$BKP_" )/$( basename "$BKP_" .tar.gz )-${CURRENT}.tar.gz"
97+
mv "$BKP_" "$BKP"
9998

10099
# simple restore if anything fails from here
101100
####################

changelog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

2-
[v0.55.3](https://github.com/nextcloud/nextcloudpi/commit/1c093f2) (2018-05-15) nc-backup: faster free space calculation. Minimize maintenance mode time
2+
[v0.55.4](https://github.com/nextcloud/nextcloudpi/commit/855a996) (2018-05-15) nc-update-netcloud: include version in backup name
33

4-
[v0.55.2](https://github.com/nextcloud/nextcloudpi/commit/2ab49f4) (2018-05-14) nc-datadir: fix php cli tmpdir
4+
[v0.55.3](https://github.com/nextcloud/nextcloudpi/commit/585518a) (2018-05-15) nc-backup: faster free space calculation. Minimize maintenance mode time
5+
6+
[v0.55.2, master](https://github.com/nextcloud/nextcloudpi/commit/2ab49f4) (2018-05-14) nc-datadir: fix php cli tmpdir
57

68
[v0.55.1 ](https://github.com/nextcloud/nextcloudpi/commit/a0a1145) (2018-05-14) nc-backup: exclude ncp-update-nc backups
79

0 commit comments

Comments
 (0)