I am new to scripting and thought I was doing rather well however I ran into a issue and I am not sure how to fix it. I am using the following command to obtain the capacity percent of the directory listed however it seems that this command gets the capacity of the whole mount rather then just the directory specified.
I only want toe capacity of archives and not the capacity of the whole mount. The folder archives is empty yet it comes back with 81% because its looking at the whole mount.
Am I using the wrong command (df)? I am not sure how to obtain what I want here.
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
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.
Sounds like you need 'du' instead of 'df' but it's going to give you the size of a file/directory not percentages.
Is there a way to convert that to percentages?
I am not concerned with the sizes of the folders leading up to the one I want to monitor. I only want the percentage full of the archives folder.
Thanks again for the help.
---------- Post updated at 08:09 AM ---------- Previous update was at 07:06 AM ----------
I see how to use the du... for example....
But I still do not understand how to figure out the capacity of the folder from the return or how to take that and turn it into a percentage.
Last edited by Yogesh Sawant; 06-26-2009 at 01:23 PM..
Reason: added code tags
The format of "df" varies across platforms. Please state you Operating System and preferred shell.
Ignoring unix quotas (rarely ever used).the maximum total size of the files in a
directory equates to the available free space in that mountpoint.
As Jim Mcnamara there is no concept of "capacity of a folder" in Unix or GNU/Linux. For starters Unix and GNU/Linux has directories not folders. And unlike Windows/DOS FAT12 or FAT16 there is no inherent limitation on the number of files in a directory. Unless you are using quotas (and generally only large organizations use quotas) the best you can do is determine the capacity of the filesystem on which the directory resides and the amount of free or allocated space on that filesystem.
As Jim Mcnamara there is no concept of "capacity of a folder" in Unix or GNU/Linux. For starters Unix and GNU/Linux has directories not folders. And unlike Windows/DOS FAT12 or FAT16 there is no inherent limitation on the number of files in a directory. Unless you are using quotas (and generally only large organizations use quotas) the best you can do is determine the capacity of the filesystem on which the directory resides and the amount of free or allocated space on that filesystem.
So I want to make sure I am understanding this correctly....
There is no way to monitor only the size of the directory?
We have file systems that may have a few directories within them that belong to different groups so I want to be able to monitor the directories independantley. So for example if I have 3 directories....
Directory 1 Belongs to Group A
Directory 2 belongs to Group B
Directory 3 belongs to Group C
If Directory 2 fills beyond 80% of its capacity I do not want Group A and C to have to check their directories when we know its not theirs thats filling things up.
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)
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)
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)
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)
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)
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)
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)