Created
February 20, 2021 12:32
-
-
Save AfvanMoopen/1f0360319147d53913adbed2c6a441cb to your computer and use it in GitHub Desktop.
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
ip_address="1.2.3.4" | |
from_user="someone@foobar.com" | |
to_user="user@foobar.com" | |
smtp_host="gogogo.gogo.com" | |
smtp_user="someone@foobar.com" | |
smtp_password="nomention" | |
df -h | grep -E "(Filesystem|sda)" | mail -S smtp-auth-user=${smtp_user} -S smtp-auth-password=${smtp_password} -S smtp=${smtp_host} -s "[LOG] ${ip_address} Disk Usage Report $(date +\%y/\%m/\%d)" -r ${from_user} -c ${to_user} ${to_user} | |
# cat msg | mail -b "bcc_user@foobar.com" -s "Email" "user@foobar.com" | |
# msmtp version | |
a='Subject: IP Address\n\n'; b=$(curl -s https://ifconfig.co); echo -e $a$b | msmtp myemail.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment