diff options
-rw-r--r-- | bin/ncp/BACKUPS/nc-backup.sh | 8 | ||||
-rw-r--r-- | changelog.md | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/bin/ncp/BACKUPS/nc-backup.sh b/bin/ncp/BACKUPS/nc-backup.sh index 7373887d..03c49566 100644 --- a/bin/ncp/BACKUPS/nc-backup.sh +++ b/bin/ncp/BACKUPS/nc-backup.sh @@ -40,12 +40,14 @@ trap fail INT TERM HUP ERR echo "check free space..." # allow at least ~500 extra MiB mkdir -p "$destdir" -dsize=$(du -sb "$datadir" | awk '{ print $1 }') nsize=$(du -sb "$basedir/nextcloud" | awk '{ print $1 }') +[[ -d "$basedir/nextcloud"/data ]] && \ + dsize=$(du -sb "$basedir/nextcloud"/data | awk '{ print $1 }') 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 + datasize=$(du -sb "$datadir" | awk '{ print $1 }') + size=$((nsize - dsize + margin + datasize)) +else size=$((nsize - dsize + margin)) fi free=$( df -B1 "$destdir" | tail -1 | awk '{ print $4 }' ) diff --git a/changelog.md b/changelog.md index 832574b3..96fab4b9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v1.11.0](https://github.com/nextcloud/nextcloudpi/commit/54fdd52) (2019-04-05) upgrade to NC15.0.6 +[v1.11.1](https://github.com/nextcloud/nextcloudpi/commit/2694c6e) (2019-04-05) nc-backup: fix space calculation + +[v1.11.0](https://github.com/nextcloud/nextcloudpi/commit/5dedeaf) (2019-04-05) upgrade to NC15.0.6 [v1.10.12](https://github.com/nextcloud/nextcloudpi/commit/a6e33b1) (2019-04-05) update UPDATE config section |