Find the answer to your Linux question:
Results 1 to 4 of 4
Iam doing a project in Free BSD and i am stuck with a puzzle. Please any one of you clarify my doubt : How to add a mechanism to check ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2006
    Posts
    4

    help me in modifying the resource configuration file in Free BSD


    Iam doing a project in Free BSD and i am stuck with a puzzle. Please any one of you clarify my doubt :

    How to add a mechanism to check the status of the file system which alerts the root user via. email if any single partition is greater than 90% full. The alert should include the file system directory name and the partition?

  2. #2
    Linux Enthusiast
    Join Date
    Feb 2005
    Location
    Luton, England, UK, Earth
    Posts
    639
    I'm not sure but it really does seem as if you are trying to get us to do your homework for you...

  3. #3
    Just Joined!
    Join Date
    Feb 2006
    Posts
    4
    Hey i didnt really mean that. Its just the part of my project work on Free BSD.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Mar 2005
    Posts
    1,431
    I'm not an awk wizard, so I used the awk part from the former thread of yours:
    Code:
    #!/bin/sh
    
    while `true`; do
            if [ `df |sed '1d'|awk '{if ($5 > 90) print $5,$6}'|wc -l` > 0 ]; then
                    echo filled up
            fi
            sleep 86400
    done
    I haven't tested it on freebsd, but you can. Replace "echo filled up" with some command to mail root. "sleep 86400" edits how long it takes (in seconds) before it re-checks how filled up the filesystems are, in the script it's set to 86400 seconds = 24 hours.

Posting Permissions

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