4.3BSD-Reno/share/man/cat1/mtree.0
MTREE(8) UNIX System Manager's Manual MTREE(8)
NNAAMMEE
mmttrreeee - map a directory hierarchy
SSYYNNOOPPSSIISS
mmttrreeee [--ccddeerruuxx] [--ff _s_p_e_c] [--pp _p_a_t_h]
DDEESSCCRRIIPPTTIIOONN
MMttrreeee compares a directory hierarchy against a specification for a direc-
tory hierarchy. By default, the specification is read from the standard
input. MMttrreeee verifies that the tree rooted in the current directory
matches the specification.
Messages are written to standard output for any files whose characteris-
tics do not match those of the specification, or which are missing from
either the specification or the tree.
The options are as follows:
--cc Print a specification for the tree to standard output.
--dd Ignore everything except directory type files.
--ee Don't object to files that are in the tree but not in the
specification.
--ff Read the specification from _f_i_l_e, instead of from standard in-
put.
--pp Traverse the tree rooted in _p_a_t_h, instead of the current direc-
tory.
--rr Remove any files in the tree that are not described in the
specification.
--uu Modify the owner, group, and permissions of existing files to
match the specification, as well as create any missing direc-
tories. Owner, group, and permissions must all be specified
for missing directories to be created.
--xx Don't descend below any mount points.
Specifications are mostly composed of ``keywords'', i.e. strings that
that specify values relating to files. No keywords have default values,
and if a keyword has no set value no checks based on it are performed.
Currently supported keywords are as follows:
cckkssuumm The checksum of the file using the algorithm specified by the
program cksum(1).
iiggnnoorree Causes the hierarchy below the file to be ignored.
ggrroouupp The group of the file; may be either numeric or symbolic.
mmooddee The current file's permissions as an absolute (octal) or sym-
bolic value (see chmod(1)).
nnlliinnkk The number of hard links the file is expected to have.
oowwnneerr The owner of the file; may be either numeric or symbolic.
ssiizzee The size, in bytes, of the file.
lliinnkk The file a symbolic link is expected to reference.
ttiimmee The last modification time of the file.
ttyyppee The type of the file; may be set to any one of the following:
bblloocckk block special device
cchhaarr character special device
ddiirr directory
ffiiffoo fifo
ffiillee regular file
lliinnkk symbolic link
ssoocckkeett socket
There are four types of lines in a specification.
The first type of line sets a ``global'' value for a keyword, and con-
sists of a leading ``/set'' followed by whitespace, followed by sets of
keyword/value pairs, separated by whitespace. Keyword/value pairs con-
sist of a keyword, followed by a equals sign (``=''), followed by a
value, without intervening whitespace. Once a keyword has been set, its
value remains unchanged until either set again or unset.
The second type of line unsets keywords and consists of a leading ``/un-
set'', followed by whitespace, followed by one or more keywords, separat-
ed by whitespace.
The third type of line is a file specification and consists of a file
name, followed by whitespace, followed by zero or more whitespace
separated keyword/value pairs. The file name may be preceded by any
number of whitespace characters. The file name may contain any of the
standard file name matching characters (``['', ``]'', ``?'' or ``*''), in
which case files in the hierarchy will be associated with the first pat-
tern that they match.
Each of the keyword/value pairs consist of a keyword, followed by an
equals sign (``=''), followed by the keyword's value, without intervening
whitespace. These values override, without changing, the global value of
the corresponding keyword.
All paths are relative. Specifying a directory will cause subsequent
files to be searched for in that directory hierarchy. Which brings us to
the last type of line in a specification: a line containing only the
string ``....'' causes the current directory path to ascend one level.
Empty lines and lines whose first non-whitespace character is a hash mark
(``#'') are ignored.
MMttrreeee exits with a status of 0 on success and >0 if an error occurred or
the tree did not match the specification.
FFIILLEESS
/_e_t_c/_m_t_r_e_e system specification directory
SSEEEE AALLSSOO
chmod(1), chown(1), chgrp(1), cksum(1), find(1), stat(2), fts(3), mkpro-
to(8)
BBUUGGSS
The cckkssuumm keyword is not yet implemented.
The ttiimmee keyword should be specifiable in human readable terms.
EEXXAAMMPPLLEE
# fs: /a/staff/rick/mybin
# by: rick
# date: Fri May 25 12:26:57 1990
/set group=staff mode=0555 nlink=1 owner=rick type=file
[ nlink=2 size=6144
adb size=53248
df group=operator mode=02555 size=20480
ps group=kmem mode=02555 size=54272
rcp owner=root mode=04555 size=79872
test nlink=2 size=6144
/set group=wheel mode=0444 nlink=1 owner=rick type=file
manpages type=dir mode=0775 nlink=2 size=1024
adb.man size=9473
df.man size=5263
tar.man size=3324
..
HHIISSTTOORRYY
4.3 Reno BSD.