The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Best possible communication mechanism between a Solaris machine and a windows machine Krsh SUN Solaris 7 02-05-2009 10:41 AM
How to get free disk space size in C/C++ program( Solaris system) yidu High Level Programming 4 01-30-2009 12:49 AM
command to find free disk space on solaris harishankar SUN Solaris 2 08-26-2007 12:47 PM
How to re-allocate disk space on solaris 10 duke0001 UNIX for Advanced & Expert Users 2 12-13-2006 11:14 AM
Disk space management on Solaris HSN SUN Solaris 5 11-25-2006 07:31 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 03-16-2009
raghu.amilineni
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Post Disk Space availability on solaris machine

Hi,

I have a question regarding finding free space on the disk of a solaris machine.

Many mount points are available in my machine. Right now i am using
df -b option to get the free disk space available.

I have an assignment to check free space on the disk.
I pass the directory as a parameter to my shell script. My shell script should read the parameter and check wether there is a sufficient space in the directory.

my inputs can be any of the follwing

/opt/Agent
/var/tmp
/var/opt/Agent
/Agent

I execued my command like this.

sh checkspace.sh /var/tmp

when the above command is executed i am getting correct result because /var/tmp exists on the machine.

if i specify sh checkspace.sh /Agent
the program halts with an error saying

block device not found.

this is because the directory is not existing.


can any one please give a solution to find free disk space when inputs /Agent and /opt/Agent are specified . the code should be same for both inputs.(should also remember /Agent is not an existing directory)


Thanks in advance
RaghuDeep Amilineni

Last edited by raghu.amilineni; 03-16-2009 at 05:13 AM..
  #2 (permalink)  
Old 03-16-2009
Shahul's Avatar
Shahul Shahul is offline
Registered User
  
 

Join Date: Aug 2008
Location: India
Posts: 175
Home work not allowed..



Thanks
SHa
  #3 (permalink)  
Old 03-16-2009
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,432
Quote:
Originally Posted by raghu.amilineni View Post
if i specify sh checkspace.sh /Agent
the program halts with an error saying

block device not found.

this is because the directory is not existing.
Did you check if directory exist first ?
  #4 (permalink)  
Old 03-17-2009
raghu.amilineni
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
The input is given as /Agent even if directory is not existing..
but it should still check for size
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 10:08 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