1bart_rules(4) File Formats bart_rules(4)
2
3
4
6 bart_rules - bart rules file
7
9 The bart_rules file is a text file that is used by the bart(1M) com‐
10 mand. The rules file determines which files to validate and which file
11 attributes of those files to ignore.
12
13
14 Some lines are ignored by the manifest comparison tool. Ignored lines
15 include blank lines, lines that consist only of white space, and com‐
16 ments that begin with #.
17
18
19 The rules file supports three directives: CHECK, IGNORE, and a subtree
20 directive, which is an absolute path name and optional pattern matching
21 modifiers. Each CHECK, IGNORE, and subtree directive must be on a sepa‐
22 rate line. Bart supports continuation of long lines using a backslash
23 (\). The rules file uses the directives to create logical blocks.
24
25 Syntax
26 The syntax for the rules file is as follows:
27
28 [IGNORE attribute...]*
29 [CHECK] [attribute...]*
30
31 subtree1 [pattern...]*
32 [IGNORE attribute...]*
33 [CHECK] [attribute...]*
34
35 subtree2 [pattern...]*
36 subtree3 [pattern...]*
37 subtree4 [pattern...]*
38 [IGNORE attribute...]*
39 [CHECK] [attribute...]*
40 ...
41
42
43 Rule Blocks
44 Rule blocks are composed of statements that are created by using direc‐
45 tives and arguments.
46
47
48 There are three types of blocks:
49
50 Global Block The first block in the file. The block is considered
51 ``global'' if it specifies CHECK and IGNORE statements,
52 but no previous subtree statement. A global block per‐
53 tains to all subsequent blocks.
54
55
56 Local block A block that specifies CHECK and IGNORE statements as
57 well as a subtree directive. The rules in this block
58 pertain to files and directories found in the specified
59 subtree.
60
61
62 Heir block A block that contains a null CHECK statement, no argu‐
63 ments. This block inherits the global CHECK statements
64 and IGNORE statements.
65
66
67
68 The order in which CHECK and IGNORE statements appear in blocks is
69 important. The bart command processes CHECK and IGNORE statements in
70 the order in which they are read, with later statements overriding ear‐
71 lier statements.
72
73
74 Subtree specifications must appear one per line. Each specification
75 must begin with an absolute path name. Optionally, each specification
76 can be followed by pattern-matching arguments.
77
78
79 When a file system being tracked belongs to more than one subtree
80 directive, bart performs the following resolution steps:
81
82 o Applies the CHECK and IGNORE statements set in the global
83 block. Note that all CHECK and IGNORE statements are pro‐
84 cessed in order.
85
86 o Finds the last subtree directive that matches the file.
87
88 o Processes the CHECK and IGNORE statements that belong to the
89 last matching subtree directive. These statements are pro‐
90 cessed in the order in which they are read, overriding
91 global settings.
92
93 Pattern Matching Statements
94 There are two types of pattern matching statements
95
96 AND For a given subtree directive, all pattern matching statements
97 are logically ANDed with the subtree. Patterns have the follow‐
98 ing syntax:
99
100 o Wildcards are permitted for both the subtree and pat‐
101 tern matching statements.
102
103 o The exclamation point (!) character represents logi‐
104 cal NOT.
105
106 o A pattern that terminates with a slash is a subtree.
107 The absence of a slash indicates that the pattern is
108 not a directory. The subtree itself does not require
109 an end slash.
110 For example, the following subtree example includes the contents
111 of /home/nickiso/src except for object files, core files, and
112 all of the SCCS subtrees. Note that directory names that termi‐
113 nate with .o and directories named core are not excluded because
114 the patterns specified do not terminate with /.
115
116 /home/nickiso/src !*.o !core !SCCS/
117 CHECK all
118
119
120
121 OR Group multiple subtree directives together. Such subtree direc‐
122 tives are logically ORed together.
123
124 /home/nickiso/src !*.o !core
125 /home/nickiso/Mail
126 /home/nickiso/docs *.sdw
127 CHECK all
128 IGNORE mtime lnmtime dirmtime
129
130 The files included in the previous example are as follows:
131
132 o Everything under /home/nickiso/src except for *.o and
133 core files
134
135 o Everything under /home/nickiso/Mail
136
137 o All files under /home/nickiso/docs that end in *.sdw
138 For these files, all attributes are checked except for modifica‐
139 tion times.
140
141
142 File Attributes
143 The bart command uses CHECK and IGNORE statements to define which
144 attributes to track or ignore. Each attribute has an associated key‐
145 word.
146
147
148 The attribute keywords are as follows:
149
150 acl ACL attributes for the file. For a file with ACL
151 attributes, this field contains the output from aclto‐
152 text().
153
154
155 all All attributes.
156
157
158 contents Checksum value of the file. This attribute is only speci‐
159 fied for regular files. If you turn off context checking or
160 if checksums cannot be computed, the value of this field is
161 -.
162
163
164 dest Destination of a symbolic link.
165
166
167 devnode Value of the device node. This attribute is for character
168 device files and block device files only.
169
170
171 dirmtime Modification time in seconds since 00:00:00 UTC, January 1,
172 1970 for directories.
173
174
175 gid Numerical group ID of the owner of this entry.
176
177
178 lnmtime Creation time for links.
179
180
181 mode Octal number that represents the permissions of the file.
182
183
184 mtime Modification time in seconds since 00:00:00 UTC, January 1,
185 1970 for files.
186
187
188 size File size in bytes.
189
190
191 type Type of file.
192
193
194 uid Numerical user ID of the owner of this entry.
195
196
198 Example 1 Sample Rules File
199
200
201 The following is a sample rules file:
202
203
204 # Global rules, track everything except dirmtime.
205 CHECK all
206 IGNORE dirmtime
207
208 # The files in /data* are expected to change, so don't bother
209 # tracking the attributes expected to change.
210 # Furthermore, by specifying ``IGNORE contents,'' you save
211 # time and resources.
212 /data*
213 IGNORE contents mtime size
214
215 /home/nickiso f* bar/
216 IGNORE acl
217
218 # For /usr, apply the global rules.
219 /usr
220 CHECK
221
222 # Note: Since /usr/tmp follows the /usr block, the /usr/tmp
223 # subtree is subjected to the ``IGNORE all.''
224 /usr/tmp
225 /home/nickiso *.o
226 /home/nickiso core
227 /home/nickiso/proto
228 IGNORE all
229
230
231
232 The following files are cataloged based on the sample rules file:
233
234
235 o All attributes, except for dirmtime, mtime, size, and con‐
236 tents, are tracked for files under the /data* subtrees.
237
238 o Files under the /usr subtree, except for /usr/tmp, are cata‐
239 loged by using the global rules.
240
241 o If the /home/nickiso/foo.c file exists, its attributes,
242 except for acl and dirmtime, are cataloged.
243
244 o All .o and core files under /home/nickiso, as well as the
245 /home/nickiso/proto and /usr/tmp subtrees, are ignored.
246
247 o If the /home/nickiso/bar/foo.o file exists, it is ignored
248 because it is subject to the last block.
249
251 bart(1M), bart_manifest(4), attributes(5)
252
253
254
255SunOS 5.11 9 Sep 2003 bart_rules(4)