Created
October 13, 2023 11:02
-
-
Save vielhuber/f36846021ef89d8ddff6718237d726d4 to your computer and use it in GitHub Desktop.
send mail alert on quota #linux #server
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 | |
CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g') | |
THRESHOLD=80 | |
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then | |
mail -s 'Project XY: Disk Space Alert' email1@tld.com, email2@tld.com, email3@tld.com << EOF | |
Your root partition remaining free space is critically low. Used: $CURRENT% | |
EOF | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment