2 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH BART_RULES 4 "Sep 9, 2003"
8 bart_rules \- bart rules file
12 The \fBbart_rules\fR file is a text file that is used by the \fBbart\fR(1M)
13 command. The rules file determines which files to validate and which file
14 attributes of those files to ignore.
17 Some lines are ignored by the manifest comparison tool. Ignored lines include
18 blank lines, lines that consist only of white space, and comments that begin
22 The rules file supports three directives: \fBCHECK\fR, \fBIGNORE\fR, and a
23 \fIsubtree\fR directive, which is an absolute path name and optional pattern
24 matching modifiers. Each \fBCHECK\fR, \fBIGNORE\fR, and \fIsubtree\fR directive
25 must be on a separate line. Bart supports continuation of long lines using a
26 backslash (\fB\e\fR). The rules file uses the directives to create logical
31 The syntax for the rules file is as follows:
35 [IGNORE \fIattribute\fR...]*
36 [CHECK] [\fIattribute\fR...]*
38 \fIsubtree1\fR [\fIpattern\fR...]*
39 [IGNORE \fIattribute\fR...]*
40 [CHECK] [\fIattribute\fR...]*
42 \fIsubtree2\fR [\fIpattern\fR...]*
43 \fIsubtree3\fR [\fIpattern\fR...]*
44 \fIsubtree4\fR [\fIpattern\fR...]*
45 [IGNORE \fIattribute\fR...]*
46 [CHECK] [\fIattribute\fR...]*
54 Rule blocks are composed of statements that are created by using directives and
58 There are three types of blocks:
65 The first block in the file. The block is considered ``global'' if it specifies
66 \fBCHECK\fR and \fBIGNORE\fR statements, but no previous subtree statement. A
67 global block pertains to all subsequent blocks.
76 A block that specifies \fBCHECK\fR and \fBIGNORE\fR statements as well as a
77 subtree directive. The rules in this block pertain to files and directories
78 found in the specified subtree.
87 A block that contains a null \fBCHECK\fR statement, no arguments. This block
88 inherits the global \fBCHECK\fR statements and \fBIGNORE\fR statements.
93 The order in which \fBCHECK\fR and \fBIGNORE\fR statements appear in blocks is
94 important. The \fBbart\fR command processes \fBCHECK\fR and \fBIGNORE\fR
95 statements in the order in which they are read, with later statements
96 overriding earlier statements.
99 Subtree specifications must appear one per line. Each specification must begin
100 with an absolute path name. Optionally, each specification can be followed by
101 pattern-matching arguments.
104 When a file system being tracked belongs to more than one subtree directive,
105 \fBbart\fR performs the following resolution steps:
110 Applies the \fBCHECK\fR and \fBIGNORE\fR statements set in the global block.
111 Note that all \fBCHECK\fR and \fBIGNORE\fR statements are processed in order.
117 Finds the last subtree directive that matches the file.
123 Processes the \fBCHECK\fR and \fBIGNORE\fR statements that belong to the last
124 matching subtree directive. These statements are processed in the order in
125 which they are read, overriding global settings.
127 .SS "Pattern Matching Statements"
130 There are two types of pattern matching statements
137 For a given subtree directive, all pattern matching statements are logically
138 ANDed with the subtree. Patterns have the following syntax:
143 Wildcards are permitted for both the subtree and pattern matching statements.
149 The exclamation point (\fB!\fR) character represents logical NOT.
155 A pattern that terminates with a slash is a subtree. The absence of a slash
156 indicates that the pattern is not a directory. The subtree itself does not
157 require an end slash.
159 For example, the following subtree example includes the contents of
160 \fB/home/nickiso/src\fR except for object files, core files, and all of the
161 SCCS subtrees. Note that directory names that terminate with \fB\&.o\fR and
162 directories named \fBcore\fR are \fBnot\fR excluded because the patterns
163 specified do not terminate with \fB/\fR.
167 /home/nickiso/src !*.o !core !SCCS/
180 Group multiple subtree directives together. Such subtree directives are
181 logically ORed together.
185 /home/nickiso/src !*.o !core
187 /home/nickiso/docs *.sdw
189 IGNORE mtime lnmtime dirmtime
193 The files included in the previous example are as follows:
198 Everything under \fB/home/nickiso/src\fR except for \fB*.o\fR and \fBcore\fR
205 Everything under \fB/home/nickiso/Mail\fR
211 All files under \fB/home/nickiso/docs\fR that end in \fB*.sdw\fR
213 For these files, all attributes are checked except for modification times.
216 .SS "File Attributes"
219 The \fBbart\fR command uses \fBCHECK\fR and \fBIGNORE\fR statements to define
220 which attributes to track or ignore. Each attribute has an associated keyword.
223 The attribute keywords are as follows:
230 ACL attributes for the file. For a file with ACL attributes, this field
231 contains the output from \fBacltotext()\fR.
249 Checksum value of the file. This attribute is only specified for regular files.
250 If you turn off context checking or if checksums cannot be computed, the value
251 of this field is \fB-\fR.
260 Destination of a symbolic link.
269 Value of the device node. This attribute is for character device files and
270 block device files only.
279 Modification time in seconds since 00:00:00 UTC, January 1, 1970 for
289 Numerical group ID of the owner of this entry.
298 Creation time for links.
307 Octal number that represents the permissions of the file.
316 Modification time in seconds since 00:00:00 UTC, January 1, 1970 for files.
343 Numerical user ID of the owner of this entry.
348 \fBExample 1 \fRSample Rules File
351 The following is a sample rules file:
356 # Global rules, track everything except dirmtime.
360 # The files in /data* are expected to change, so don't bother
361 # tracking the attributes expected to change.
362 # Furthermore, by specifying ``IGNORE contents,'' you save
363 # time and resources.
365 IGNORE contents mtime size
367 /home/nickiso f* bar/
370 # For /usr, apply the global rules.
374 # Note: Since /usr/tmp follows the /usr block, the /usr/tmp
375 # subtree is subjected to the ``IGNORE all.''
386 The following files are cataloged based on the sample rules file:
392 All attributes, except for \fBdirmtime\fR, \fBmtime\fR, \fBsize\fR, and
393 \fBcontents\fR, are tracked for files under the \fB/data*\fR subtrees.
399 Files under the \fB/usr\fR subtree, except for \fB/usr/tmp\fR, are cataloged by
400 using the global rules.
406 If the \fB/home/nickiso/foo.c\fR file exists, its attributes, except for
407 \fBacl\fR and \fBdirmtime\fR, are cataloged.
413 All \fB\&.o\fR and \fBcore\fR files under \fB/home/nickiso\fR, as well as the
414 \fB/home/nickiso/proto\fR and \fB/usr/tmp\fR subtrees, are ignored.
420 If the \fB/home/nickiso/bar/foo.o\fR file exists, it is ignored because it is
421 subject to the last block.
426 \fBbart\fR(1M), \fBbart_manifest\fR(4), \fBattributes\fR(5)