Fixed bug in du command

If a dir contains a number, it is no longer added to the disk usage
This commit is contained in:
matthias@arch 2022-05-02 19:01:20 +02:00
parent 4c05443b6e
commit fa30fead69
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ license=('GPL3')
depends=('rsync') depends=('rsync')
optdepends=('mkrypt: for encryption') optdepends=('mkrypt: for encryption')
source=(msynk.sh _msynk.compdef.zsh msynk.1.man template) source=(msynk.sh _msynk.compdef.zsh msynk.1.man template)
md5sums=(d22b062903a9fcd1bd9508cbd06cbc6c 8398678146d9f8a5669e8b788502b3b8 d089828a93bf8e4ffd9051d8ea756ab8 492028aa2f08528f1d476376884959b2) md5sums=(c9fc4a54a7081d0ee3e7c43a636b47c3 8398678146d9f8a5669e8b788502b3b8 d089828a93bf8e4ffd9051d8ea756ab8 492028aa2f08528f1d476376884959b2)
package() { package() {
mkdir -p "${pkgdir}/usr/bin" mkdir -p "${pkgdir}/usr/bin"

View File

@ -117,7 +117,7 @@ sync_sender_to_receiver()
if [[ -n $encrypt ]]; then if [[ -n $encrypt ]]; then
# check if TMP_DIR has enough space # check if TMP_DIR has enough space
tmp_free=$(df --output=avail $TMP_DIR | grep -E "[[:digit:]]+") tmp_free=$(df --output=avail $TMP_DIR | grep -E "[[:digit:]]+")
path_size=$(du -s "$path" | sed -e "s/[^0-9]//g") path_size=$(du -s "$path" | awk '{print $1}' | sed -e "s/[^0-9]//g")
if [[ $tmp_free -le $path_size ]]; then if [[ $tmp_free -le $path_size ]]; then
printf "$FMT_ERROR" "Not enough space on $TMP_DIR to copy $path! $TMP_DIR $tmp_free free - Size $path: $path_size" printf "$FMT_ERROR" "Not enough space on $TMP_DIR to copy $path! $TMP_DIR $tmp_free free - Size $path: $path_size"
printf "$FMT_MESSAGE" "" "If using a tmpfs, you can increase its size by running: 'sudo mount -o remount,size=XXG,noatime /tmp' to increase the size to XXG (You will need a large enough swap space)" printf "$FMT_MESSAGE" "" "If using a tmpfs, you can increase its size by running: 'sudo mount -o remount,size=XXG,noatime /tmp' to increase the size to XXG (You will need a large enough swap space)"