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:
authornachoparker <nacho@ownyourbits.com>2019-03-27 04:03:02 +0300
committernachoparker <nacho@ownyourbits.com>2019-04-02 03:03:51 +0300
commitc18273a0f69669dc8846e786ded7501cd46aeb96 (patch)
treee92e176157d116ad9cc79f7269f3fbe8a3eb8827
parent41a4e84a3eab6c0661c860ab2f6cf032cf886add (diff)
nc-backup: fix space calculationv1.10.8
-rw-r--r--bin/ncp/BACKUPS/nc-backup.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ncp/BACKUPS/nc-backup.sh b/bin/ncp/BACKUPS/nc-backup.sh
index c3e48d6c..c44b2c53 100644
--- a/bin/ncp/BACKUPS/nc-backup.sh
+++ b/bin/ncp/BACKUPS/nc-backup.sh
@@ -41,10 +41,10 @@ trap fail INT TERM HUP ERR
echo "check free space..." # allow at least ~100 extra MiB
mkdir -p "$destdir"
[[ "$includedata" == "yes" ]] && \
- dsize=$(du -s "$datadir" | awk '{ print $1 }')
-nsize=$(du -s "$basedir/nextcloud" | awk '{ print $1 }')
+ dsize=$(du -sb "$datadir" | awk '{ print $1 }')
+nsize=$(du -sb "$basedir/nextcloud" | awk '{ print $1 }')
size=$((nsize + dsize + 100*1024))
-free=$( df "$destdir" | tail -1 | awk '{ print $4 }' )
+free=$( df -B1 "$destdir" | tail -1 | awk '{ print $4 }' )
[ $size -ge $free ] && {
echo "free space check failed. Need $size Bytes";