Sponsored Content
Top Forums Shell Programming and Scripting Capacity of directory... Pulling hair out :-) Post 302329256 by jim mcnamara on Friday 26th of June 2009 11:01:00 AM
Old 06-26-2009
You are asking the system a question for which there is no sensible answer. Free space is by FILESYSTEM, not directory. If the filesystem mountpoint is the directory, then free space is for the directory (which == filesystem) and all of its children.

You can ask are there any files in the directory, or how many bytes are used by the files in the directory. Then
Code:
 100 * (bytes used/bytes in filesystem)

gives an approximate answer. This doesn't take into account the fact that files are uusally mapped onto a minimum allocated disk space. For example, a 1 byte file actually uses say 1024 bytes, and a 480 byte file is also stored in a 1024 byte parking place.

480 + 1 = 481 but the actual used space is really 2048 - in this example.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

i'm pulling my hair out getting a solaris 8 box to work as a caching name server

i've gone through the sun docs as well as a Solaris Network Admin book. while the book is fair, it lacks detail and i'm sure there are things it's missing on getting a caching only name server working. as for the sun docs... what it has is really miserable. i can't make anything out of it. ... (4 Replies)
Discussion started by: xyyz
4 Replies

2. AIX

How to increase capacity?

Hello everybody, is a very simple question how can I increase the capacity of a disk wich is on a DS4300?, I have done the procedure on the Storage Manager but the space is the same on the AIX (5.3) , what should I do to obtain the new ammount of disk space? (16 Replies)
Discussion started by: GermanSkull
16 Replies

3. AIX

capacity planning on aix

Hi All, What do you usually use for capacity planning on AIX? Any idea will do? Thanks in advance, itik (1 Reply)
Discussion started by: itik
1 Replies

4. Shell Programming and Scripting

Monitor capacity of directory

Good morning. I have been attempting to find a way to monitor the capacity of a directory so that when it reaches 80% or higher I can send an event. I was able to find a script that does this for the whole drive by I can not seem to figure out how to do this for just a single directory. ... (1 Reply)
Discussion started by: LRoberts
1 Replies

5. Shell Programming and Scripting

Filesystems using more than 75% capacity

i need to write a shell script for printing the list of filesystems whose disk utilization is more than 75%...i tried using df -h along with awk but cud'nt make the combination work.....:wall: when we do df -h then the filesystems which are using more than 75% capacity shud be printed according to... (11 Replies)
Discussion started by: xtatic
11 Replies

6. Shell Programming and Scripting

Can't Commit Directory... is this guy pulling my leg?

Hello, I hired a coder a couple weeks ago to develop 3 small modules for a popular CMS. I created Github repos for each module so as to manage the code and allow others to download it at will. The CMS in question is structured in such a way that each module is housed in its own... (2 Replies)
Discussion started by: fern
2 Replies

7. AIX

TSM capacity

Dears, The TSM storage that we have is already configured to backup some Application,directories & logs or let's say backup different path from 15 servers, I want to add more Items to be backuped by this storage, how to be confirmed if that possible or not? I mean how do we know the capacity of... (7 Replies)
Discussion started by: arm
7 Replies

8. AIX

Directories getting 100% capacity

I am new to using AIX but ive ran into issues with 100% full and then rebooting and having a socket error repeating over and over. My question is, what can I do besides just monitoring to ensure I dont run into these issues? Scripts? anything? Thanks (3 Replies)
Discussion started by: terry.berger
3 Replies

9. AIX

FS capacity

can anyone tell me how to reduce Fs capacity by using echo zero. (3 Replies)
Discussion started by: nkchand
3 Replies
DISK_FREE_SPACE(3)							 1							DISK_FREE_SPACE(3)

disk_free_space - Returns available space on filesystem or disk partition

SYNOPSIS
float disk_free_space (string $directory) DESCRIPTION
Given a string containing a directory, this function will return the number of bytes available on the corresponding filesystem or disk partition. PARAMETERS
o $directory - A directory of the filesystem or disk partition. Note Given a file name instead of a directory, the behaviour of the function is unspecified and may differ between operating sys- tems and PHP versions. RETURN VALUES
Returns the number of available bytes as a float or FALSE on failure. EXAMPLES
Example #1 disk_free_space(3) example <?php // $df contains the number of bytes available on "/" $df = disk_free_space("/"); // On Windows: $df_c = disk_free_space("C:"); $df_d = disk_free_space("D:"); ?> NOTES
Note This function will not work on remote files as the file to be examined must be accessible via the server's filesystem. SEE ALSO
disk_total_space(3). PHP Documentation Group DISK_FREE_SPACE(3)
All times are GMT -4. The time now is 08:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy