Hello i have a script in sheel for sending email when my disk is full %. But i not received email.
How i verif if the service of email work fine?
My code:
#!/bin/bash
script that will send an email to EMAIL when disk use in partition PART is bigger than %MAX
adapt these 3 parameters to your case
MAX=70
[email protected]
PART=/dev/vda1
USE=df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1
if [ $USE -gt $MAX ]; then
echo “Percent used: $USE” | mail -s “Running out of disk space” $EMAIL
fi
Thx!