email notification when HDD fills up

sysadmin sysadmin at fleetone.com
Fri Jan 23 18:47:59 UTC 2004


We use this in a script. YMMV:

touch /tmp/mail.txt
USEPERCENT=`df / | egrep / | gawk '{print $5}' | sed s/%//`
echo "${USEPERCENT}"
if [ ${USEPERCENT} > 75 ]
then
mail you at yourdomain.com -s "Warning, / is at ${USEPERCENT}" < /tmp/mail.txt
rm /tmp/mail.txt
fi

Rob
  ----- Original Message ----- 
  From: Genti A. Hila 
  To: fedora-list at redhat.com 
  Sent: Friday, January 23, 2004 12:32 PM
  Subject: email notification when HDD fills up


  Hi guys,

  Another question now. If the hard drive fills up, is there any way that when you have only a certain amount of space free, to make the system send to you a notification email ?

  Genti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20040123/e91c0451/attachment-0001.htm>


More information about the fedora-list mailing list