5 \h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
7 .TH fshash 1 "8 October 2012" rsync-backup
30 program generates digests of filesystems. It's similar in concept to
31 (but somewhat different from) Ian Jackson's
35 The idea is to capture everything interesting about a filesystem in a
36 file with the following properties:
39 The digest file describes everything `interesting' about the filesystem,
40 such that two filesystems which are interestingly different will have
44 If two filesystems aren't different in any interesting way, then their
45 digests should be identical.
48 Given two subtly different filesystems, it's easy for a human equipped
49 with digests for them and
51 to work out what the differences actually are.
52 .SS Command-line processing
53 The following command-line arguments are accepted.
56 Show a summary of the command-line syntax, and exit successfully.
59 Show the program's version number, and exit successfully.
62 Clear the cache of information about all files except those processed in
65 .B \-c, \-\-cache=\fIfile
66 Keep a cache of file hashes in the
68 The cache is keyed by inode and modification time: if a file has an
69 entry in the cache already then it won't be hashed again, which can
70 provide a valuable performance improvement on large filesystems. If the
72 doesn't exist, then it will be created.
74 .B \-f, \-\-files=\fIformat
75 Read a list of filenames on standard input in the given
77 and write digest lines for them. The
81 for simple null-terminated names, as produced by
82 .BR "find \-\-print0" ;
85 for file data as produced by
87 The latter is useful, since
89 has powerful file inclusion and exclusion capabilities \(en and a common
90 use case is generating a digest for a collection of files copied using
94 format doesn't work well: see
98 .B \-H, \-\-hash=\fIhash
101 function, which can be any hash function supported by Python's
103 This option may be omitted: if it is, then the hash is read from the
104 cache file; if there is no cache file either, then an error is reported.
107 Rather than produce a manifest, read a unified
109 from standard input, and clear from the cache all files mentioned as
110 being different. Filenames in the diff are considered relative to
112 defaulting to the current working directory.
114 Positional arguments are interpreted as files and directories to be
115 processed, in order. A directory name which ends in
117 is treated specially:
119 writes filenames relative to the given directory.
121 Information about each filesystem object is written on a separate line.
122 These lines can be quite long, and consist of a number of fields:
124 For regular files, a cryptographic hash of the file's content, in
125 hexadecimal. For other kinds of filesystem object, a description of the
126 object type and any special information about it, in square brackets,
127 and padded with spaces so as to take the same width as a hash; see
130 A `virtual inode identifier': a string which will be the same in two
131 lines if and only if they represent hard links to the same underlying
132 inode. Some care is taken so that files are assigned the same
133 identifier even if other parts of the filesystem are different, so as to
134 avoid spurious differences.
136 The object's permissions and mode bits, in octal.
138 The file's owner and group, in decimal, separated by a colon.
140 The file's last-modified time, in UTC, in ISO8601 format, i.e.,
141 .IB yyyy \(en mm \(en dd T hh : mm : ss Z \fR.
143 The file's size in bytes, in decimal.
145 The file's name (relative to some appropriate parent directory).
147 would cause ambiguity are escaped: tab, linefeed and carriage return are
160 and other codes outside the range 32\(en127 are printed as hex escaped,
163 Finally, the sequence
167 so that symlink targets are presented unambiguously (see below).
169 For non-regular file objects, the first field is an information field
170 enclosed in square brackets, and some of the other fields provide other
171 information or are suppressed, follows.
174 If there was an error reading the object's metadata then the information
178 and the other fields, except the name, are printed as
180 rather than having any useful information.
183 The information field shows
187 The information field shows
191 The information field shows
193 The name is followed by
195 and the link target (or
196 .BI <E nn \~ message >
197 if there was an error reading the link destination).
200 The information field shows
202 and the size field shows
204 (since directory sizes are not consistent across filesystem
205 implementations). The name is followed by
208 .I Block and character devices
209 The information field shows
212 .BR character-device ,
213 as appropriate, followed by the major and minor device numbers in
214 decimal, and separated by a colon.
217 No attempt is made to sort filenames read in
219 format, so they're not very likely to match digests produced any other
220 way. Indeed, they're not very likely to match digests produced by
222 on other machines either.
229 Mark Wooding, <mdw@distorted.org.uk>