From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,aaa91bc4b6f1fc9f,start X-Google-Attributes: gidfee84,public From: matt@perutz.salk.edu (Matthew Bowen Harrington) Subject: Here's a util for AdvFS user disk stats Date: 1995/05/08 Message-ID: <3ok8fu$hhk@riscsm.scripps.edu>#1/1 X-Deja-AN: 102194891 content-type: text/plain; charset=us-ascii organization: The Scripps Research Institute, La Jolla, CA mime-version: 1.0 newsgroups: comp.unix.osf.osf1 #!/usr/local/bin/perl #"duh" by Matthew Harrington (matt@sbl.salk.edu) #The Salk Institute, La Jolla, CA # #A perl5 script to display disk usage by user. It is specific to #Digital Unix and DEC's Advanced Filesystem (AdvFS). The variables #$hostname, $domain, and $fileset names are unique to your system and #will need to be changed. It's not the most beautiful script but I #wrote it as my first venture in Perl. # #Note: you must have your /etc/hosts.equiv correct to permit "rsh" # #Version 1.0 05/07/95 (P.S. "duh" is for "du" and "h"ome -- disk usage # home disk) $hostname = "yourhostname"; #This is here because I export the user #directory to other machines which need #to run this script $domain = "home_domain"; #The AdvFS domain which holds your user fileset $fileset = "users"; #The user fileset print "\n"; print "Hold on a sec...\n"; print "\n"; open(VQUOTPROC, "rsh $hostname /usr/sbin/vquot -f $domain#$fileset|"); @data = ; close(VQUOTPROC); open(SIZEPROC, "rsh $hostname /usr/bin/df -k $domain#$fileset|"); @disksize = ; close(SIZEPROC); $_ = $disksize[1]; @sizetemp = split; $size = $sizetemp[1]; print " User Number of Files KB Used % of user disk\n"; print " ---- --------------- ------- --------------\n"; $end = @data; $count = 1; while ( $count ne $end ){ $_ = $data[$count]; @words = split; $percent = $words[0] / $size * 100; write ; $count = $count + 1 } format STDOUT = @#. @<<<<<<<<< @####### @##### @##.## $count,$words[2], $words[1], $words[0], $percent .