Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Here's a util for AdvFS user disk stats
@ 1995-05-08  4:00 Matthew Bowen Harrington
  0 siblings, 0 replies; only message in thread
From: Matthew Bowen Harrington @ 1995-05-08  4:00 UTC (permalink / raw)



#!/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 = <VQUOTPROC>;
close(VQUOTPROC);

open(SIZEPROC, "rsh $hostname /usr/bin/df -k $domain#$fileset|");
@disksize = <SIZEPROC>;
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
.  




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-05-08  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-05-08  4:00 Here's a util for AdvFS user disk stats Matthew Bowen Harrington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox