Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script for Disk Usage

Status
Not open for further replies.

Thief

Technical User
Apr 19, 2001
92
US
Hi there,
Help needed desperately for building a script to identify the disk space used by users on different file systems across different servers. The OS is IRIX 6.5.

Thanx in advance Thief................ ::)
(I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us .)
 
Hi,
do an ls -l sort by the OWNER and add up the file sizes.

Unfortuantely this only works if you have read permissions on the directories.

from a more powerful language like PERL you could STAT the files and sum them up by userid, and group id

($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);

Use the Passwd map translate a UID into a users name
Use the group map to translate a GRPID into a Group name.

 
yea thanx for the reply...but i got a script running on aix and all i had to do is just mount all the filesystems and get a beautiful log for all users Thief................ ::)
(I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us .)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top