This is a one-liner to “alarm” if the disk usage of a filesystem has exceeded a certain threshold. I put the directory to monitor as “~” (home) and the threshold as 40%.
test `df -h ~ | grep -o '[0-9]*%' | grep -o '[0-9]*'` -ge 40 && echo high
This is a one-liner to “alarm” if the disk usage of a filesystem has exceeded a certain threshold. I put the directory to monitor as “~” (home) and the threshold as 40%.
test `df -h ~ | grep -o '[0-9]*%' | grep -o '[0-9]*'` -ge 40 && echo high
alarm, bash, csh, disk-usage, script, sh, shell, tcsh
This entry was posted on August 4, 2007, 12:51 pm and is filed under Shell Tricks. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.
Fusion theme by digitalnature | powered by WordPress
Entries (RSS) and Comments (RSS) ^
Bad Behavior has blocked 156 access attempts in the last 7 days.