-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afd1494
commit cce9aa2
Showing
6 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
============== | ||
Useful scripts | ||
============== | ||
|
||
Low disk space alert | ||
-------------------- | ||
|
||
:: | ||
|
||
#!/bin/bash | ||
CURRENT=$(df /data | grep / | awk '{ print $5}' | sed 's/%//g') | ||
THRESHOLD=90 | ||
|
||
echo "$CURRENT" | ||
|
||
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then | ||
echo "Low Disk Space Alert: ${CURRENT}% used" | ||
mail -s 'Disk Space Alert' admin@gmail.com << EOF | ||
Backup server remaining free space is critically low. Used: $CURRENT% | ||
EOF | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
======== | ||
Sendmail | ||
======== | ||
|
||
Send mail from console:: | ||
|
||
(echo "Subject:Hi"; echo "Body contents";) | sendmail -v -F "test" my@mail |