Skip to content

Instantly share code, notes, and snippets.

@lyoshenka
Created March 24, 2014 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyoshenka/9740210 to your computer and use it in GitHub Desktop.
Save lyoshenka/9740210 to your computer and use it in GitHub Desktop.
Send yourself an email when your root disk fills up
#!/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