Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Regd: Email alret when hard disk full

    Hi All,

    I have installed & configured ubuntu 12.04(LTS) server successfully.

    Now i want to get email alert when my server hard disk gets full.

    Please advice me how to configure it


    Jeyachandran M

  2. #2
    Linux Newbie
    Join Date
    Sep 2012
    Nashville, TN
    I don't take credit for the following script. I found this on Linux Journal. But I have tested and it works on both Mac OS X and Linux
    CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
    if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
        mail -s 'Disk Space Alert' << EOF
    Your root partition remaining free space is critically low. Used: $CURRENT%
    save this to a script then add it to a cron job and have it test like every 5 minutes or 10 minutes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts