فهرست منبع

improved free space check in backup function

Serghey Rodin 13 سال پیش
والد
کامیت
1069543a18
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      bin/v-backup-user

+ 2 - 1
bin/v-backup-user

@@ -376,7 +376,8 @@ local_backup(){
     fi
 
     # Checking disk space
-    disk_usage=$(df $BACKUP | awk '{print $5}'|tail -n1|cut -f 1 -d '%')
+    disk_usage=$(df $BACKUP |tail -n1 |tr ' ' '\n' |grep % |cut -f 1 -d %)
+
     if [ "$disk_usage" -ge "$BACKUP_DISK_LIMIT" ]; then
         echo "Error: Not enough disk space"
         log_event "$E_DISK" "$EVENT"