|
|
1.1 ! root 1: .\" Copyright (c) 1989, 1990 The Regents of the University of California. ! 2: .\" All rights reserved. ! 3: .\" ! 4: .\" Redistribution and use in source and binary forms are permitted provided ! 5: .\" that: (1) source distributions retain this entire copyright notice and ! 6: .\" comment, and (2) distributions including binaries display the following ! 7: .\" acknowledgement: ``This product includes software developed by the ! 8: .\" University of California, Berkeley and its contributors'' in the ! 9: .\" documentation or other materials provided with the distribution and in ! 10: .\" all advertising materials mentioning features or use of this software. ! 11: .\" Neither the name of the University nor the names of its contributors may ! 12: .\" be used to endorse or promote products derived from this software without ! 13: .\" specific prior written permission. ! 14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 17: .\" ! 18: .\" @(#)mtree.1 5.7 (Berkeley) 7/24/90 ! 19: .\" ! 20: .Dd July 24, 1990 ! 21: .Dt MTREE 8 ! 22: .Os BSD 4.4 ! 23: .Sh NAME ! 24: .Nm mtree ! 25: .Nd map a directory hierarchy ! 26: .Sh SYNOPSIS ! 27: .Nm mtree ! 28: .Op Fl cderux ! 29: .Op Fl f Ar spec ! 30: .Op Fl p Ar path ! 31: .Sh DESCRIPTION ! 32: .Nm Mtree ! 33: compares a directory hierarchy against a specification for a ! 34: directory hierarchy. ! 35: By default, the specification is read from the standard input. ! 36: .Nm Mtree ! 37: verifies that the tree rooted in the current directory matches the ! 38: specification. ! 39: .Pp ! 40: Messages are written to standard output for any files whose ! 41: characteristics do not match those of the specification, or which are ! 42: missing from either the specification or the tree. ! 43: .Pp ! 44: The options are as follows: ! 45: .Tp Fl c ! 46: Print a specification for the tree to standard output. ! 47: .Tp Fl d ! 48: Ignore everything except directory type files. ! 49: .Tp Fl e ! 50: Don't object to files that are in the tree but not in the specification. ! 51: .Tp Fl f ! 52: Read the specification from ! 53: .Ar file , ! 54: instead of from standard input. ! 55: .Tp Fl p ! 56: Traverse the tree rooted in ! 57: .Ar path , ! 58: instead of the current directory. ! 59: .Tp Fl r ! 60: Remove any files in the tree that are not described in the ! 61: specification. ! 62: .Tp Fl u ! 63: Modify the owner, group, and permissions of existing files to match ! 64: the specification, as well as create any missing directories. ! 65: Owner, group, and permissions must all be specified for missing ! 66: directories to be created. ! 67: .Tp Fl x ! 68: Don't descend below any mount points. ! 69: .Tp ! 70: .Pp ! 71: Specifications are mostly composed of ``keywords'', i.e. strings that ! 72: that specify values relating to files. ! 73: No keywords have default values, and if a keyword has no set value no ! 74: checks based on it are performed. ! 75: .Pp ! 76: Currently supported keywords are as follows: ! 77: .Tw Cm ! 78: .Tp Cm cksum ! 79: The checksum of the file using the algorithm specified by ! 80: the program ! 81: .Xr cksum 1 . ! 82: .Tp Cm ignore ! 83: Causes the hierarchy below the file to be ignored. ! 84: .Tp Cm group ! 85: The group of the file; may be either numeric or symbolic. ! 86: .Tp Cm mode ! 87: The current file's permissions as an absolute (octal) or symbolic ! 88: value (see ! 89: .Xr chmod 1 ) . ! 90: .Tp Cm nlink ! 91: The number of hard links the file is expected to have. ! 92: .Tp Cm owner ! 93: The owner of the file; may be either numeric or symbolic. ! 94: .Tp Cm size ! 95: The size, in bytes, of the file. ! 96: .Tp Cm link ! 97: The file a symbolic link is expected to reference. ! 98: .Tp Cm time ! 99: The last modification time of the file. ! 100: .Tp Cm type ! 101: The type of the file; may be set to any one of the following: ! 102: .Tw Cm ! 103: .Tp Cm block ! 104: block special device ! 105: .Tp Cm char ! 106: character special device ! 107: .Tp Cm dir ! 108: directory ! 109: .Tp Cm fifo ! 110: fifo ! 111: .Tp Cm file ! 112: regular file ! 113: .Tp Cm link ! 114: symbolic link ! 115: .Tp Cm socket ! 116: socket ! 117: .Tp ! 118: .Tp ! 119: .Pp ! 120: There are four types of lines in a specification. ! 121: .Pp ! 122: The first type of line sets a ``global'' value for a keyword, and ! 123: consists of a leading ``/set'' followed by whitespace, followed by ! 124: sets of keyword/value pairs, separated by whitespace. ! 125: Keyword/value pairs consist of a keyword, followed by a equals sign ! 126: (``=''), followed by a value, without intervening whitespace. ! 127: Once a keyword has been set, its value remains unchanged until either ! 128: set again or unset. ! 129: .Pp ! 130: The second type of line unsets keywords and consists of a leading ! 131: ``/unset'', followed by whitespace, followed by one or more keywords, ! 132: separated by whitespace. ! 133: .Pp ! 134: The third type of line is a file specification and consists of a file ! 135: name, followed by whitespace, followed by zero or more whitespace ! 136: separated keyword/value pairs. ! 137: The file name may be preceded by any number of whitespace characters. ! 138: The file name may contain any of the standard file name matching ! 139: characters (``['', ``]'', ``?'' or ``*''), in which case files ! 140: in the hierarchy will be associated with the first pattern that ! 141: they match. ! 142: .Pp ! 143: Each of the keyword/value pairs consist of a keyword, followed by an ! 144: equals sign (``=''), followed by the keyword's value, without intervening ! 145: whitespace. ! 146: These values override, without changing, the global value of the ! 147: corresponding keyword. ! 148: .Pp ! 149: All paths are relative. ! 150: Specifying a directory will cause subsequent files to be searched ! 151: for in that directory hierarchy. ! 152: Which brings us to the last type of line in a specification: a line ! 153: containing only the string ! 154: .Dq Nm \&.. ! 155: causes the current directory ! 156: path to ascend one level. ! 157: .Pp ! 158: Empty lines and lines whose first non-whitespace character is a hash ! 159: mark (``#'') are ignored. ! 160: .Pp ! 161: .Nm Mtree ! 162: exits with a status of 0 on success and >0 if an error occurred or the ! 163: tree did not match the specification. ! 164: .Sh FILES ! 165: .Dw /etc/mtree ! 166: .Di L ! 167: .Dp Pa /etc/mtree ! 168: system specification directory ! 169: .Dp ! 170: .Sh SEE ALSO ! 171: .Xr chmod 1 , ! 172: .Xr chown 1 , ! 173: .Xr chgrp 1 , ! 174: .Xr cksum 1 , ! 175: .Xr find 1 , ! 176: .Xr stat 2 , ! 177: .Xr fts 3 , ! 178: .Xr mkproto 8 ! 179: .Sh BUGS ! 180: The ! 181: .Cm cksum ! 182: keyword is not yet implemented. ! 183: .Pp ! 184: The ! 185: .Cm time ! 186: keyword should be specifiable in human readable terms. ! 187: .Sh EXAMPLE ! 188: .Ds I ! 189: # fs: /a/staff/rick/mybin ! 190: # by: rick ! 191: # date: Fri May 25 12:26:57 1990 ! 192: .sp ! 193: /set group=staff mode=0555 nlink=1 owner=rick type=file ! 194: [ nlink=2 size=6144 ! 195: adb size=53248 ! 196: df group=operator mode=02555 size=20480 ! 197: ps group=kmem mode=02555 size=54272 ! 198: rcp owner=root mode=04555 size=79872 ! 199: test nlink=2 size=6144 ! 200: .sp ! 201: /set group=wheel mode=0444 nlink=1 owner=rick type=file ! 202: manpages type=dir mode=0775 nlink=2 size=1024 ! 203: adb.man size=9473 ! 204: df.man size=5263 ! 205: tar.man size=3324 ! 206: \&.. ! 207: .De ! 208: .Sh HISTORY ! 209: 4.3 Reno BSD.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.