Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: matt@perutz.salk.edu (Matthew Bowen Harrington)
Subject: Here's a util for AdvFS user disk stats
Date: 1995/05/08	[thread overview]
Message-ID: <3ok8fu$hhk@riscsm.scripps.edu> (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
.  




                 reply	other threads:[~1995-05-08  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

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