1BRD(1) General Commands Manual BRD(1)
2
3
4
6 brd - scans directories and files for damage due to decay of storage
7 medium.
8
10 SCANNING DIRECTORIES:
11 brd [general-options] scan [scan-options] target [target ...]
12
13
14 LISTING DATABASE CONTENTS:
15 brd [general-options] list [list-options] [target ...]
16
17
18 SEARCHING FOR DUPLICATE FILES:
19 brd [general-options] dupe_files [dupe_files-options]
20
21
22 SEARCHING FOR DUPLICATE SUBTREES:
23 brd [general-options] dupe_trees [dupe_trees-options]
24
25
26 DIFFING TREES:
27 brd [general-options] diff [diff-options] left-target right-target
28
29
30 REMOVING ITEMS FROM THE DATABASE:
31 brd [general-options] rm [rm-options] target [target ...]
32
33
34 CHECKING THE DATABASE:
35 brd [general-options] checkdb [checkdb-options]
36
37
38 general-options
39 [-h] [--version] [-l,--log [FILENAME]]
40 [-v,--verbose] [-d,--debug] [--db [FILENAME]]
41
42
43 scan-options
44 [-h] [--use-root [ROOT_NAME]]
45 [--root-prefix [PREFIX]]] [-p,--prune]
46 [-P,--progress] [--check-only] [--dry-run]
47 [-s,--skip-recent] [--expr [DAYS]]
48
49
50 list-options
51 [-h] [--use-root [ROOT_NAME]] [-m,--minimal]
52 [--root-prefix [PREFIX]]] [-e,--expanded]
53
54
55
56 dupe_files-options
57 [-h] [-o,--output [FILENAME]]
58
59
60 dupe_trees-options
61 [-h] [-o,--output [FILENAME]] [--nofilefp]
62 [--nofilename] [--nosubdirfp] [--nosubdirname]
63 [--nodirname]
64
65
66 diff-options
67 [-h] [-o,--output [FILENAME]]
68 [--use-root [ROOT_NAME]]] [--root-prefix [PREFIX]]
69
70
71 rm-options
72 [-h] [--use-root [ROOT_NAME]]
73 [--root-prefix [PREFIX]]] [--dry-run]
74
75 checkdb-options
76 [-h] [-P,--progress] [--check-only] [--dry-run]
77
78
80 Bit Rot Detector, or brd, is a tool to scan a directory tree and check
81 each file for corruption caused by damage to the physical storage
82 medium or by damage from malicious programs. Files are fingerprinted
83 using the SHA-1 algorithm. File fingerprints, sizes, and modification
84 times are stored in a SQLite database.
85
86 Multiple unrelated directory trees can be stored in the same database.
87 All trees are identified by the base directory, or root, as specified
88 on the command-line. Note that the following are considered different
89 trees:
90 some_dir/
91 ./some_dir/
92
93 Subtrees can be specified anywhere roots can as long as the full root
94 to subtree path is specified. However, the subtree must already exist
95 in the database. If the subtree is not currently in the database, it
96 will be considered to be a new root. For example, the following will
97 scan some_dir as a new root and add all of its children to the data‐
98 base, then scan the subtree some_subtree for problems and/or changes:
99 # Add new root
100 brd scan some_dir
101 # Scan only part of a root for problems and changes.
102 brd scan some_dir/some_subtree
103
104 Note: the default behavior for scan is to update the database for any
105 files that are newer than the database record. Files that have been
106 tampered with will likely be flagged as updated and not as damaged. To
107 properly check for files that have been tampered with, run scan with
108 the --check-only option.
109
110 Since scanning large trees or trees with large files can take quite a
111 while, it is possible to exclude files in directories that have
112 recently been checked via the -s option. How recent is "recent" is con‐
113 trolled by the --expr option and defaults to 30 days.
114
115 The integrity of the database can be checked via the checkdb subcom‐
116 mand.
117
118 In addition to checking files for corruption, brd provides the ability
119 to search the database for duplicate files and subtrees, as well as
120 diff subtrees. See the dupe_files, dupe_trees, and diff subcommands
121 for details.
122
123
124 GENERAL OPTIONS
125 These options can be used in all the different modes.
126
127 -h, --help
128 Display the command-line help. When specified after a subcommand
129 name, subcommand-specific help will be displayed.
130
131 --version
132 Displays script version number and quits.
133
134 -l,--log FILENAME
135 Logs output to the specified file instead of the console.
136
137 -v,--verbose
138 Enables additional messages to screen and/or log file.
139
140 -d,--debug
141 Enables debug messages to screen and/or log file.
142
143 --db FILENAME
144 Specifies the name of the database to use. Defaults to
145 "./brd.db"
146
147
148 SCANNING OPTIONS
149 The following options are available with the scan subcommand:
150
151 --use-root ROOT_NAME
152 Strips the path information from all targets and uses the speci‐
153 fied ROOT_NAME instead, when interacting with the database.
154
155 --root-prefix PREFIX
156 Appends the specified PREFIX to each target when interacting
157 with the database useful for only scanning a subtree as opposed
158 to the entire tree.
159
160 -p,--prune
161 Removes all records for files and directories that no longer
162 exist. If this option is not specified, missing files and direc‐
163 tories will generate a warning. With this option, missing items
164 will be noted only if --verbose is used.
165
166 -P,--progress
167 Displays a progress indicator.
168
169 --check-only
170 Behaves like normal, except that no changes are committed to the
171 database.
172
173 --dry-run
174 This command is a synonym for --check-only.
175
176 -s,--skip-recent
177 Skips recently scanned directories and their contents. Default
178 cut-off is 30 days. See --expr for how to specify the cut-off.
179
180 --expr DAYS
181 Scans are considered recent for up to, and including, DAYS days.
182 The default value is 30 days. See --skip-recent for info on
183 skipping recently scanned directories and their contents.
184
185
186 LISTING OPTIONS
187 The following options are available with the list subcommand:
188
189 --use-root ROOT_NAME
190 Strips the path information from all targets and uses the speci‐
191 fied ROOT_NAME instead, when interacting with the database.
192
193 --root-prefix PREFIX
194 Appends the specified PREFIX to each target when interacting
195 with the database useful for only scanning a subtree as opposed
196 to the entire tree.
197
198 -m,--minimal
199 When displaying information on directory targets, only directory
200 contents are displayed.
201
202 -e,--expanded
203 Displays additional information for directory targets.
204
205
206 DUPLICATE FILES OPTIONS
207 The following options are available with the dupe_files subcommand:
208
209 -o,--output FILENAME
210 Writes the list of duplicate files to the specified file name.
211 Useful when --verbose or --debug are used.
212
213
214 DUPLICATE SUBTREES OPTIONS
215 The following options are available with the dupe_trees subcommand:
216
217 -o,--output FILENAME
218 Writes the list of duplicate subtrees to the specified file
219 name. Useful when --verbose or --debug are used.
220
221 --nofilefp
222 When generating the fingerprint for a directory, do not include
223 the fingerprints of files associated with it.
224
225 --nofilename
226 When generating the fingerprint for a directory, do not include
227 the file names of files associated with it.
228
229 --nosubdirfp
230 When generating the fingerprint for a directory, do not include
231 the fingerprints of subdirectories.
232
233 --nosubdirname
234 When generating the fingerprint for a directory, do not include
235 the names of subdirectories.
236
237 --nodirname
238 When generating the fingerprint for a directory, do not include
239 the directory's name.
240
241
242 DIFF OPTIONS
243 The following options are available with the diff subcommand:
244
245 -o,--output FILENAME
246 Writes the results to the specified file name. Useful when
247 --verbose or --debug are used.
248
249 --use-root ROOT_NAME
250 Strips the path information from all targets and uses the speci‐
251 fied ROOT_NAME instead, when interacting with the database.
252
253 --root-prefix PREFIX
254 Appends the specified PREFIX to each target when interacting
255 with the database useful for only scanning a subtree as opposed
256 to the entire tree.
257
258
259 REMOVAL OPTIONS
260 The following options are available with the rm subcommand:
261
262 --use-root ROOT_NAME
263 Strips the path information from all targets and uses the speci‐
264 fied ROOT_NAME instead, when interacting with the database.
265
266 --root-prefix PREFIX
267 Appends the specified PREFIX to each target when interacting
268 with the database useful for only scanning a subtree as opposed
269 to the entire tree.
270
271 --dry-run
272 Behaves like normal, except that no changes are committed to the
273 database.
274
275
276 DATABASE CHECK OPTIONS
277 The following options are available with the checkdb subcommand:
278
279 -P,--progress
280 Displays a progress indicator.
281
282 --check-only
283 Behaves like normal, except that no changes are committed to the
284 database.
285
286 --dry-run
287 This command is a synonym for --check-only.
288
289
291 README
292 http://github.com/jsbackus/brd/wiki
293
294
296 Copyright © 2013 Jeff Backus <jeff.backus@gmail.com> License GPLv2+:
297 GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
298 This is free software: you are free to change and redistribute it.
299 There is NO WARRANTY, to the extent permitted by law.
300
302 Jeff Backus <jeff.backus@gmail.com>
303
304
305
306Jeff Backus 28 May 2014 BRD(1)