Created
October 11, 2016 14:49
-
-
Save thomas4g/984aa6643c4e9f6d49f13894160b9090 to your computer and use it in GitHub Desktop.
Checks disk usage and rings bell forever if > 90%
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# TODO: don't hard-code the disk in the grep command | |
raw_usage=$(df -h | grep -e "50G" | xargs | cut -d' ' -f4) | |
usage=${raw_usage//%} | |
echo $raw_usage | |
if [ $usage -gt 90 ]; then | |
while (true); do | |
tput bell | |
sleep 1 | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment