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:
authorpaschaef <45995338+paschaef@users.noreply.github.com>2019-04-05 04:07:55 +0300
committernachoparker <nacho@ownyourbits.com>2019-04-05 04:21:46 +0300
commitb11c13e5313f9d147df5169666d71b4753027893 (patch)
treeec4bb8dd88cc350b7c17d87d3199e678a692f888
parent5af854b0d6ca0bba989da0ec24a196df3c33f2f9 (diff)
nc-backup: improve needed space calculation (#864)v1.10.10
-rw-r--r--bin/ncp/BACKUPS/nc-backup.sh12
-rw-r--r--changelog.md4
-rwxr-xr-xupdate.sh2
3 files changed, 13 insertions, 5 deletions
diff --git a/bin/ncp/BACKUPS/nc-backup.sh b/bin/ncp/BACKUPS/nc-backup.sh
index c44b2c53..7373887d 100644
--- a/bin/ncp/BACKUPS/nc-backup.sh
+++ b/bin/ncp/BACKUPS/nc-backup.sh
@@ -38,12 +38,16 @@ fail() { local ret=$?; echo "Abort..." ; rm -f "${dbbackup}" "${destfile}"; $
trap cleanup EXIT
trap fail INT TERM HUP ERR
-echo "check free space..." # allow at least ~100 extra MiB
+echo "check free space..." # allow at least ~500 extra MiB
mkdir -p "$destdir"
-[[ "$includedata" == "yes" ]] && \
- dsize=$(du -sb "$datadir" | awk '{ print $1 }')
+dsize=$(du -sb "$datadir" | awk '{ print $1 }')
nsize=$(du -sb "$basedir/nextcloud" | awk '{ print $1 }')
-size=$((nsize + dsize + 100*1024))
+margin=$((500*1024*1024)) # safety margin for database and some extra
+if [[ "$includedata" == "yes" ]]; then
+ size=$((nsize + margin))
+else #datadir is inside $basedir/nextcloud therefore substract
+ size=$((nsize - dsize + margin))
+fi
free=$( df -B1 "$destdir" | tail -1 | awk '{ print $4 }' )
[ $size -ge $free ] && {
diff --git a/changelog.md b/changelog.md
index d43f47e3..ae9eea49 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,7 @@
-[v1.10.9](https://github.com/nextcloud/nextcloudpi/commit/2778a83) (2019-04-01) letsencrypt: dont return error if notif fails
+[v1.10.10](https://github.com/nextcloud/nextcloudpi/commit/e06a4f6) (2019-04-05) nc-backup: improve needed space calculation (#864)
+
+[v1.10.9](https://github.com/nextcloud/nextcloudpi/commit/5af854b) (2019-04-01) letsencrypt: dont return error if notif fails
[v1.10.8 ](https://github.com/nextcloud/nextcloudpi/commit/c18273a) (2019-03-26) nc-backup: fix space calculation
diff --git a/update.sh b/update.sh
index 10b06e52..6294ee88 100755
--- a/update.sh
+++ b/update.sh
@@ -227,6 +227,8 @@ EOF
EOF
chmod +x /etc/letsencrypt/renewal-hooks/deploy/ncp
+ # update nc-backup
+ install_app nc-backup
# remove redundant opcache configuration. Leave until update bug is fixed -> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815968
# Bug #416 reappeared after we moved to php7.2 and debian buster packages. (keep last)