nc-backup: improve needed space calculation (#864)

This commit is contained in:
paschaef 2019-04-05 03:07:55 +02:00 committed by nachoparker
parent 5af854b0d6
commit b11c13e531
3 changed files with 13 additions and 5 deletions

View File

@ -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 }')
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 ] && {

View File

@ -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

View File

@ -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)