Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, i want to preparing a shell script. I want that the script check for all the mount points on my server and if any mount point have disk space ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    20

    To check disk space if it filled more that 90%

    Hi,

    i want to preparing a shell script. I want that the script check for all the mount points on my server and if any mount point have disk space full more than or equal to 90%, it alert me. so that i can take appropriate action. please help. Thanks .

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Use output of df -h command to check used space of all mounted partitions.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Jan 2008
    Posts
    20
    That's Okay, thanks for it.. But how the script will check and tell me that this particular partition filled more that 90%. Let i have these mount point /inder,/mnt/home and / . Let only /inder is filled upto95%, rest is fine and is not in critical state. How can the script check and print a message for me that /inder has 95% space filled ????

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Extract Mounted On and Use% columns from each line of df -h output using grep, sed or awk.
    Just compare Use% value and display appropriate message. Check the manual of grep and sed.
    Code:
    man grep
    man sed
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Just Joined!
    Join Date
    Jan 2008
    Posts
    20
    Thanks...

Posting Permissions

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