[net.sources] sqzdir man page

jca (01/30/83)

.TH SQZDIR 8 "LOCAL-WRITTEN" "SB-MSG"
.SH NAME
sqzdir  \- squeeze empty entries from directories
.SH SYNOPSIS
.B sqzdir
[
.B \-r
] [
.B \-l
] [
.B \-v
] dirname ...
.SH DESCRIPTION
.I Sqzdir
removes the unused entries in a directory.
Normally a directory does not shrink when files or
subdirectories are deleted.
Rather, the entries in a directory are zeroed out, and
remain in the directory as dead space.
By using
.I sqzdir,
all unused entries in a directory will be deleted, and
the actual size of the directory decreases.
.PP
When many files or subdirectories are deleted from a large directory,
there is wasted space due to the unused entries.
In many cases, indirect blocks have to be searched and performance
of the system as a whole suffers while this is occurring.
This problem is extremely troublesome in cases where such a
directory is used very frequently.
.TP 8
.B \-r
Specifies that
.I sqzdir
be performed recursively on subdirectories found under
the main directory specified on the command line.
Normally, only the main directory is squeezed.
.TP
.B \-l
Will cause
.B sqzdir
to just give the report without squeezing any directories.
The use of this flag automatically sets the
.B \-v
flag.
.TP
.B \-v
Turns on verbose mode.
This will give a report on how many entries are in a directory,
how many are subdirectories, and how many are unused.
If the
.B \-r
flag is also used, the report will show how many levels down
in subdirectories
.B sqzdir
is working.
.PP
.I Sqzdir
takes directories as arguments.
The directory names must not be the current directory or
the directory of a currently mounted file system.
If a directory is specified that is above the current
directory or a mounted file system then nothing will be
done to the directory that contains that entry.
.PP
Because the system calls
.IR link (2)
and
.IR unlink (2)
operations are performed on directories,
.I sqzdir
may only be run by the superuser.
.PP
Another helpful thing
.I sqzdir
does is reorder the remaining entries.
Subdirectory entries are placed at the top in
order of last accessed first, other entries follow
in order of last accessed first.
By placing subdirectories first will help speed path searching.
.PP
The access and modify times for files will not be changed,
but the access and modify times for directories will be updated.
The owner, group, and mode of all files and subdirectories remain
the same.
.SH FILES
.ta 2i
SQZ\fR\fIppppp.llnn\fR  Temporary directory at recursive level \fIll\fR.
.SH "SEE ALSO"
mkdir(1), rmdir(1), link(2), unlink(2), dcopy(8M)
.SH BUGS
If any process is active in a directory being squeezed, there
may be unpredictable results.
It is best to run
.I sqzdir
on a quiet system.
.PP
Like
.IR mkdir (1),
.I sqzdir
performs functions that for short periods of time
the file system is in an unclean state.
.PP
If a directory has subdirectories and the
.B \-r
flag is used, there will be 1 unused entry in that directory when
.B sqzdir
completes.
The entry was used for a temporary directory,
which is a small price to pay if recovering many other unused entries
and having the directory in a better used order.
.SH AUTHOR
.nf
Jackson C. Allen
Southern Bell T & T
Minicomputer Support Group (MSG)
SU609 675 West Peachtree Street
Atlanta Georgia  30375
.fi