mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 21:19:59 +00:00
Fix check_disk_space().
This commit is contained in:
@@ -50,10 +50,9 @@ check_disk_space() {
|
||||
local bytes_margin="${4:-0}"
|
||||
|
||||
# Real/actual bytes used and bytes free.
|
||||
|
||||
local used_bytes=$(perl -ane 'm!^/! && print $F[2] * 1024' "$file")
|
||||
local free_bytes=$(perl -ane 'm!^/! && print $F[3] * 1024' "$file")
|
||||
local pct_used=$(perl -ane 'm!^/! && print ($F[4] =~ m/(\d+)/)' "$file")
|
||||
local used_bytes=$(tail -n 1 "$file" | perl -ane 'print $F[2] * 1024')
|
||||
local free_bytes=$(tail -n 1 "$file" | perl -ane 'print $F[3] * 1024')
|
||||
local pct_used=$(tail -n 1 "$file" | perl -ane 'print ($F[4] =~ m/(\d+)/)')
|
||||
local pct_free=$((100 - $pct_used))
|
||||
|
||||
# Report the real values to the user.
|
||||
|
Reference in New Issue
Block a user