[ca.unix] File Size distribution survey, attempt 2, oops.

jrg@Apple.COM (John R. Galloway Jr.) (08/07/90)

Oh fudge!!  The little simple trivial easy scripts I sent out earlier today
are really messed up.  Not only do they not run on bsd, but even when they do
run, due to inclusion of a script from another awk set (i have script overload)
the results are worthless.  sorry for the screw up.   (proving once again that
you can't QA your own products, and never buy the first model year :-)

Also it was pointed out (by Dave Olson) that the scripts are not prevented
from going down NFS mounted file systems.  While getting info on these is
fine by me, this might make the scripts take a REALLY long time (and allow
potential recursive loops?).  So watch out for that, I couldn't come up with
an easy test (find -local does not seem to be universal).

It was also pointed out that I didn't mention why I want this info.  Well
Galloway Research (currently just me, but someday...) is working on a new
high performance high reliability (quite radical, no its not RAID) file
system architecture.  Currently I am funded by NASA (through the SBIR program
just finished phase I, going for phase II) and hope to license the resulting
technology (code, gate arrays, boards, etc.) to computer system vendors
starting in 1992/3 (more funds won't be available till 91, using goverment
funds is time consuming, but the VC's were not interested since the cash
flow from license fees/royalities is too low for them, and I like keeping the
company anyway).  Anyway I need the info to confirm some results I have
already worked out using my own system and a large vax vms system as a basis.
I just want to get more data points.  That is all I am prepared to say for
now, excpet that the first prototype will likely be on Sun, and likely be VME
(thus allowing at least demos on lots of systems) with s S-bus board following
soon there after (micro channel, nubus, .... even os/2 who knows?).

So here are the new scripts, and again sorry for messing this up.  I hope
(boy do I hope) that these work (i tested them on ultirx and aux which
are the only two bsd and sysv systems i have access to).  thanks for
your indulgence!
	-jrg
p.s.
	shar does not seem to like to overwrite files, so just delete the
old stuff before unsharing this. nothing from the old shar is needed.


#! /bin/sh
##  This is a shell archive.  Remove anything before this line, then unpack
##  it by saving it into a file and typing "sh file".  To overwrite existing
##  files, type "sh file -c".  You can also feed this as standard input via
##  unshar, or by typing "sh <file".  If this archive is complete, you will
##  see the following message at the end:
#		"End of shell archive."
# Contents:  count.awk fsize.awk read.me sizes_bsd.sh sizes_sysv.sh
# Wrapped by jrg@apple.com on Tue Aug  7 01:42:04 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f count.awk -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"count.awk\"
else
echo shar: Extracting \"count.awk\" \(186 characters\)
sed "s/^X//" >count.awk <<'END_OF_count.awk'
XBEGIN {match=1;count=0;printf("  files     4K blocks\n")}
X{if ($1 == match) count++; else {printf("%6d   %6d\n", count,match);count=1;match=$1}}
XEND {printf("%6d   %6d\n", count,match)}
END_OF_count.awk
if test 186 -ne `wc -c <count.awk`; then
    echo shar: \"count.awk\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f fsize.awk -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"fsize.awk\"
else
echo shar: Extracting \"fsize.awk\" \(51 characters\)
sed "s/^X//" >fsize.awk <<'END_OF_fsize.awk'
X{if (NF > 2) printf "%.0f\n" , ($5 + 4095) / 4096}
END_OF_fsize.awk
if test 51 -ne `wc -c <fsize.awk`; then
    echo shar: \"fsize.awk\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f read.me -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"read.me\"
else
echo shar: Extracting \"read.me\" \(1379 characters\)
sed "s/^X//" >read.me <<'END_OF_read.me'
XThese (new) scripts produce a historgram of the file sizes on your system.
XThe sizes.sh script takes an arg as the dir to start with (the top of
Xtthe tree).  The current dir is used if no arg is given.
X
XThere were several problems with the orignal bunch, none the least of which
Xwas that the consolidate.awk macro was from a different set and caused very
Xbogus results (and wasn't needed anway).  I could not think of (at least an
Xeasy) way to prevent it from going into NFS dirs, so watch out for that (I
Xdon't care, but it might take a REALLY long time).  There are not 2
Xshell scripts one for bsd that uses /bin/ls -lgR and one for sys V
Xthat uses /bin/ls -lR.
X
XIdeally as root, beig in the dir containg the scripts, you would say:
X
X# sizes_bsd.sh / >size.out
Xor for system V
X# sizes_sysv.sh / >sizes.out
X
Xsizes_bsd.sh 	a 1 line shell script that pipes an ls -lR / into the other
X		scripts, result is written to std out so you need to provide
X		a bucket for output.  Should work with csh, ksh, or sh.
X		If you would send the resulting output file
X		to jrg@galloway.sj.ca.us (or fernwood!galloway!jrg) I would
X		greatly appreciate it.
Xsizes_sysv.sh	same thing for bsd, live and learn
Xfsize.awk	an awk script that strips out the file size parameter from the
X		ls -l listing and divides it by 4k, rounded up
Xcount.awk	an awk script that counts the like entries in a sorted list
X
END_OF_read.me
if test 1379 -ne `wc -c <read.me`; then
    echo shar: \"read.me\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f sizes_bsd.sh -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"sizes_bsd.sh\"
else
echo shar: Extracting \"sizes_bsd.sh\" \(67 characters\)
sed "s/^X//" >sizes_bsd.sh <<'END_OF_sizes_bsd.sh'
X/bin/ls -lgR $1| awk -f ./fsize.awk | sort -n | awk -f ./count.awk
END_OF_sizes_bsd.sh
if test 67 -ne `wc -c <sizes_bsd.sh`; then
    echo shar: \"sizes_bsd.sh\" unpacked with wrong size!
fi
chmod +x sizes_bsd.sh
# end of overwriting check
fi
if test -f sizes_sysv.sh -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"sizes_sysv.sh\"
else
echo shar: Extracting \"sizes_sysv.sh\" \(66 characters\)
sed "s/^X//" >sizes_sysv.sh <<'END_OF_sizes_sysv.sh'
X/bin/ls -lR $1| awk -f ./fsize.awk | sort -n | awk -f ./count.awk
END_OF_sizes_sysv.sh
if test 66 -ne `wc -c <sizes_sysv.sh`; then
    echo shar: \"sizes_sysv.sh\" unpacked with wrong size!
fi
chmod +x sizes_sysv.sh
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0
-- 
internet   jrg@galloway.sj.ca.us  John R. Galloway, Jr.
applelink  d3413                  CEO..receptionist         795 Beaver Creek Way
human     (408) 259-2490          Galloway Research         San Jose, CA  95133