NAME
mmttrreeee - map a directory hierarchy
SYNOPSIS
mmttrreeee [-LLPPUUccddeeiinnqqrruuxx] [-ff spec] [-KK keywords] [-kk keywords] [-pp path]
[-ss seed] [-XX exclude-list]
DESCRIPTION
The utility mmttrreeee compares the file hierarchy rooted in the current directory against a specification read from the standard input. Messages are written to the standard output for any files whose characteristics do not match the specifications, or which are missing from either the file hierarchy or the specification. The options are as follows:-LL Follow all symbolic links in the file hierarchy.
-PP Don't follow symbolic links in the file hierarchy, instead consider
the symbolic link itself in any comparisons. This is the default.-UU Modify the owner, group and permissions of existing files to match
the specification and create any missing directories or symboliclinks. User, group and permissions must all be specified for miss-
ing directories to be created. Corrected mismatches are not con-
sidered errors.-cc Print a specification for the file hierarchy to the standard out-
put.-dd Ignore everything except directory type files.
-ee Don't complain about files that are in the file hierarchy, but not
in the specification.-ii Indent the output 4 spaces each time a directory level is descended
when create a specification with the -cc option. This does not
affect either the /set statements or the comment before each direc-
tory. It does however affect the comment before the close of each directory.-nn Do not emit pathname comments when creating a specification. Nor-
mally a comment is emitted before each directory and before theclose of that directory when using the -cc option.
-qq Quiet mode. Do not complain when a ``missing'' directory cannot be
created because it is already exists. This occurs when the direc-
tory is a symbolic link.-rr Remove any files in the file hierarchy that are not described in
the specification.-uu Same as -UU except a status of 2 is returned if the file hierarchy
did not match the specification.-xx Don't descend below mount points in the file hierarchy.
-ff file
Read the specification from file, instead of from the standard input.-KK keywords
Add the specified (whitespace or comma separated) keywords to the current set of keywords.-kk keywords
Use the ``type'' keyword plus the specified (whitespace or comma separated) keywords instead of the current set of keywords.-pp path
Use the file hierarchy rooted in path, instead of the current directory.-ss seed
Display a single checksum to the standard error output that repre-
sents all of the files for which the keyword cckkssuumm was specified. The checksum is seeded with the specified value.-XX exclude-list
The specified file contains fnmatch(3) patterns matching files to be excluded from the specification, one to a line. If the patterncontains a `/' character, it will be matched against entire path-
names (relative to the starting directory); otherwise, it will be matched against basenames only. No comments are allowed in theexclude-list file.
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 value set, no checks based on it are performed. Currently supported keywords are as follows:cckkssuumm The checksum of the file using the default algorithm speci-
fied by the cksum(1) utility.ffllaaggss The file flags as a symbolic name. See chflags(1) for infor-
mation on these names. If no flags are to be set the string ``none'' may be used to override the current default. iiggnnoorree Ignore any file hierarchy below this file. ggiidd The file group as a numeric value. ggnnaammee The file group as a symbolic name.mmooddee The current file's permissions as a numeric (octal) or sym-
bolic value. nnlliinnkk The number of hard links the file is expected to have. nnoocchhaannggee Make sure this file or directory exists but otherwise ignore all attributes. uuiidd The file owner as a numeric value. uunnaammee The file owner as a symbolic name. ssiizzee The size, in bytes, of the file. lliinnkk The file the 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 The default set of keywords are ffllaaggss, ggiidd, mmooddee, nnlliinnkk, ssiizzee, lliinnkk, ttiimmee, and uuiidd. There are four types of lines in a specification. The first type of line sets a global value for a keyword, and consists ofthe string ``/set'' followed by whitespace, followed by sets of key-
word/value pairs, separated by whitespace. Keyword/value pairs consist of a keyword, followed by an equals sign (``=''), followed by a value, without whitespace characters. Once a keyword has been set, its value remains unchanged until either reset or unset. The second type of line unsets keywords and consists of the string ``/unset'', followed by whitespace, followed by one or more keywords, separated by whitespace. The third type of line is a file specification and consists of a filename, followed by whitespace, followed by zero or more whitespace sepa-
rated keyword/value pairs. The file name may be preceded by 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 pattern 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 whitespace characters. 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.
The mmttrreeee utility exits with a status of 0 on success, 1 if any error occurred, and 2 if the file hierarchy did not match the specification. Astatus of 2 is converted to a status of 0 if the -UU option is used.
FILES/etc/mtree system specification directory
DIAGNOSTICS The mmttrreeee utility exits 0 on success, and >0 if an error occurs.SEE ALSO
chflags(1), chgrp(1), chmod(1), cksum(1), stat(2), fts(3), chown(8) HISTORYThe mmttrreeee utility appeared in 4.3BSD-Reno. The MD5 digest capability was
added in FreeBSD 2.1, in response to the widespread use of programs whichcan spoof cksum(1). The SHA-1 and RIPEMD160 digests were added in
FreeBSD 4.0, as new attacks have demonstrated weaknesses in MD5. Support for file flags was added in FreeBSD 4.0, and mostly comes from NetBSD. BSD February 26, 1999 BSD