Created
March 24, 2014 13:37
-
-
Save lyoshenka/9740210 to your computer and use it in GitHub Desktop.
Send yourself an email when your root disk fills up
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 | |
disk_space=`df -h | grep -oP "[0-9]+(?=% /$)"` | |
[[ "$disk_space" -ge 90 ]] && { echo "Root disk is $disk_space% full" | mail alex@usetopscore.com -s "SERVERNAME Root Disk $disk_space% full" ; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment