Skip to content

Commit

Permalink
nc-backup: fix space calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Apr 2, 2019
1 parent 41a4e84 commit c18273a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/ncp/BACKUPS/nc-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit c18273a

Please sign in to comment.