Disk Space availability on solaris machine


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Disk Space availability on solaris machine
# 1  
Old 03-16-2009
Java 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 06:13 AM..
raghu.amilineni
# 2  
Old 03-16-2009
Home work not allowed..


Smilie
Thanks
SHa
# 3  
Old 03-16-2009
Quote:
Originally Posted by raghu.amilineni
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  
Old 03-17-2009
The input is given as /Agent even if directory is not existing..
but it should still check for size
raghu.amilineni
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Df -k command shows duplicate information in Solaris machine, How to get the exact disk space

While getting the total disk space in solaris machine using df -k command, i am getting the same disk info for every user available in that system. Is there any way to remove it. Filesystem 1024-blocks Used Available Capacity Mounted on rpool/ROOT/solaris 573898752... (3 Replies)
Discussion started by: prasankn
3 Replies

2. Solaris

How to create mirror disk in solaris machine?

hi, I'm newbie in Solaris 10. can someone explain me the steps of how to create mirror disk in Solaris machine. thanks in advance (5 Replies)
Discussion started by: Wong_Cilacap
5 Replies

3. Solaris

disk space solaris 10

I got 4 hd each of 75GB. The os sun solaris 10 is installed on disk 0 and is almost full. see at df -k shows the following $ df -k Dateisystem kByte belegt verfügbar Kapazität Eingehängt auf /dev/dsk/c1t0d0s0 6856805 6388140 400097 95% / /devices 0 ... (3 Replies)
Discussion started by: j2me
3 Replies

4. Solaris

How to utilize the 2nd hard disk space in x86 solaris 5.10

I have 2 hard disks ,one hard disk(40gb) completely for windows Os,and the other(120gb) for solaris Os. In the second hard disk.I have utilised around 10gb for the solaris installation and also partitioned with the available 10gb space for the solaris x86 OS. Now i need to utilise the... (8 Replies)
Discussion started by: jayaprakash
8 Replies

5. Solaris

solaris 8 / disk space almost full

Hi All, My Solaris 8 firewall server is getting full on the / filesystem. I don't know which one should I delete. I think there's no more to delete on the file like logs or temp file. Does someone knows about deleting a safe file (or folder) on FS like /usr, /opt, /platform, /kernel, /sbin?... (7 Replies)
Discussion started by: itik
7 Replies

6. Programming

How to get free disk space size in C/C++ program( Solaris system)

How to get free disk space size in C/C++ program( Solaris system)? Is there any standard function or system function? Just like "df" or "getdfree" in Linux. (4 Replies)
Discussion started by: yidu
4 Replies

7. Solaris

command to find free disk space on solaris

In linux df is the command to find free space what is the equivalent command in the Solaris (2 Replies)
Discussion started by: harishankar
2 Replies

8. UNIX for Advanced & Expert Users

How to re-allocate disk space on solaris 10

I am not very good at UNIX and seek help here. I tried to install Oracle 10g on a 64 bit Sun sparc machine with solaris 10 as OS. After I installed solaris 10, the current file system on the machine looks like this: /dev/dsk/c0t0d0s0 5104758 4854293 199418 97% / /devices ... (2 Replies)
Discussion started by: duke0001
2 Replies

9. Solaris

Disk space management on Solaris

Hi, I'm using sun solaris. Using df -h I have the following: Filesystem size used avail capacity Mounted on /dev/md/dsk/d2 12G 7.1G 4.6G 61% / /proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% ... (5 Replies)
Discussion started by: HSN
5 Replies
Login or Register to Ask a Question