Skip to content

Commit 1069543

Browse files
committed
improved free space check in backup function
1 parent e9e3323 commit 1069543

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/v-backup-user

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ local_backup(){
376376
fi
377377

378378
# Checking disk space
379-
disk_usage=$(df $BACKUP | awk '{print $5}'|tail -n1|cut -f 1 -d '%')
379+
disk_usage=$(df $BACKUP |tail -n1 |tr ' ' '\n' |grep % |cut -f 1 -d %)
380+
380381
if [ "$disk_usage" -ge "$BACKUP_DISK_LIMIT" ]; then
381382
echo "Error: Not enough disk space"
382383
log_event "$E_DISK" "$EVENT"

0 commit comments

Comments
 (0)