Skip to content

Commit

Permalink
nc-update-netcloud: include version in backup name
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed May 15, 2018
1 parent e36a214 commit a57c9f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 5 additions & 6 deletions bin/ncp-update-nc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
####################
Expand Down
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit a57c9f6

Please sign in to comment.