The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to delete line with matching text and line immediately after orahi001 UNIX for Dummies Questions & Answers 6 01-15-2008 12:34 AM
please help immediately infyanurag Linux 4 11-02-2007 10:06 AM
Please respond immediately deepti.1104 Shell Programming and Scripting 3 08-31-2007 03:01 AM
UIDs being overwritten immediately xsys2000 AIX 2 05-08-2007 02:00 PM
Need a Shell Program immediately praji Shell Programming and Scripting 4 01-22-2002 04:09 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-23-2007
Sheethal Sheethal is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 28
To find the disk space capacity

Hi Everyone,


I am writing a script, in that i want to find out whether my disk space usage capacity extends more than 98%. If my disk space capacity extends more than 98% i want to print that the space capacity is running out of space otherwise i want to print only the capacity of the space used.

df -k | awk '($5 >= "98%") {print $6 "is running out of space " $5}'

can any one tell me whether the above statement is correct and also please correct the above statement accordingly to my requirement. i am very new to Unix and i do no how to use the if else commmand in the awk command and also i do no whether we can able to compare the value in percentage

Kindly please help me on this.

Thanks in advance.
  #2 (permalink)  
Old 07-24-2007
Sheethal Sheethal is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 28
I need help immediately. Please help me

Hi Everyone,

I am very new to unix.

I am writing a script, in that i want to find out whether my mount(/apps/documentum/dba) space usage capacity extends more than 98%. If my mount space capacity extends more than 98% i want to print that the space capacity is running out of space otherwise i want to print only the capacity of the space used.

df -k | awk '($5 >= "98%") {print $6 "is running out of space " $5}'

can any one tell me whether the above statement is correct and also please correct the above statement accordingly to my requirement. I do no how to use the if else commmand in the awk command and also i do no whether we can able to compare the value in percentage

Kindly please help me on this.

Thanks in advance.
  #3 (permalink)  
Old 07-24-2007
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Please stick to the rules. Do not bump your posts.

I have merged both the posts.
  #4 (permalink)  
Old 07-24-2007
ravinandan ravinandan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 16
I don't want to be rude here but haven't you already tried this on your *nix box
or did you just made up this command while writing out this post.

And you should read the forum faq before posting.(No pleading!!!)

Here is the command you are looking for.
df -k | awk ' { if ($1 == "/apps/documentum/dba") {du=substr($5,1,index($5,"%")); if(du >= 98) {print $6 "is running out of space " $5 } } }'

Tinker it to your needs.

Ravinandan
  #5 (permalink)  
Old 07-26-2007
Sheethal Sheethal is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 28
Hi Ravinandan

Thank you for your timely help!!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0