[comp.unix.wizards] disk use management

rich@cfi.COM (rich) (09/20/88)

How many times have you frantically had to answer this question:

    "Who is using up all the #&$%@ space on this disk?!".

This happens to us all the time.  Does anyone know of the existence of a
program like 'du' that shows disk use by directory for a specific file system
(i.e., one that does not traverse mounted file systems)?  I have tried writing
a shell script to use 'find' with the '-xdev' option and du, but to no avail.
The problem is to get du to avoid mounted subdirectories.  What I'd really like
is a 'du' that takes a filesystem arg (like 'dump' does).  The main reason for
not using a single 'du' on a file server is speed ('du' on NFS-mounted systems
runs much slower than on local disks).

Our situation is that we have a network of 10 Sun 3s of varying types, two
that are running 4.0 and the rest running 3.4.  We have a nighttime production
environment that requires 50-150 MB of disk space, depending on the scheduled
production tasks (basically, tons of troff'ing).  We have the production areas
spread across two file servers (two disks each), along with many users and some
development areas.  Periodically, we run low on space on one or more of the
server disks.

I intend to write a script that will gather disk usage stats nightly and
allow us to compare current usage with an optimal, historical "snapshot" on
a directory-by-directory basis.  For reasons of speed, each machine will dump
its own disk usage stats to a central area.

This can hardly be a unique need - has anyone written or seen an appropriate
disk management utility?  BTW, we do not have a source license, so those
solutions are out.

Any help will be greatly appreciated.
-- 
Rich Baughman     The Consumer Financial Institute:  617-899-6500
rich@CFI.COM
{{decvax!yale}|allegra|ihnp4|{ucbvax!cbosgd}}!ima!cfisun!rich

ccea3@rivm.UUCP (Adri Verhoef) (09/21/88)

In article <294@mars.UUCP> rich@cfi.COM (Rich Baughman -CFI-) writes:
>How many times have you frantically had to answer this question:
>
>    "Who is using up all the #&$%@ space on this disk?!".

>I intend to write a script that will gather disk usage stats nightly and
>allow us to compare current usage with an optimal, historical "snapshot" on
>a directory-by-directory basis.  For reasons of speed, each machine will dump
>its own disk usage stats to a central area.
>- has anyone written or seen an appropriate
>disk management utility?


Maybe I can be of some help.  I had to write a program that counts disk usage
that is used up by all our users per directory on each computer (3B2,VAX: SysV)
and maintains a database and sends reports to the "Disk Administrator" and
warns the users who use too much disk space (according to a specific quotum)
(and eventually, after several warnings, the program will shut them off, i.e.
they can't log in (they only get a special message), until they are given room
to clean up in their homedirectory (or in the directory for which they are
responsible), or they are assigned another quotum).

We have more than 20 computers with system V, and for this utility we have
a person managing this database, user passwords, new users, removal of users,
etc.: the Disk Administrator or, Manager of Disk Capacity.

The fields in the database:
Directory name; Department/Account; Username; Responsible Username; Quotum;
Used up this time; Message counter.

With it goes:
a) a change to the /etc/profile to prevent 'disk abusers' from logging in.
b) the nightly shell-job 'duacct'.
c) the shell-program that makes immediate reports from the database, 'dushow'.
d) 'finddir', a C-program to find directories to a certain depth / level.
e) a file containing additional information for 'disk abusers'.
f) the - easy to maintain - database, with possibility of backing up.
g) a permissions file (for logging in).

The Files:
-rwxr-x---   1 bin      bin        28533 Aug 22 17:55 duacct
-rwxr-xr-x   1 bin      bin         5602 May 24 14:31 dushow
-rwxr-x---   1 bin      bin        15746 Dec 22  1987 finddir

So far I have not been able to write any documentation about it.

Still interested?  If so, write again!

	Adri Verhoef,
	mcvax!rivm!a3