Blob


1 .TH VBACKUP 8
2 .SH NAME
3 vbackup, vcat, vftp, vmount, vnfs \-
4 back up Unix file systems to Venti
5 .SH SYNOPSIS
6 .B vbackup
7 [
8 .B -DVnv
9 ]
10 [
11 .B -M
12 .I mtpt
13 ]
14 [
15 .B -m
16 .I host
17 ]
18 [
19 .B -s
20 .I secs
21 ]
22 [
23 .B -w
24 .I n
25 ]
26 .I disk
27 [
28 .I score
29 ]
30 .PP
31 .B vcat
32 [
33 .B -z
34 ]
35 .I disk
36 |
37 .I score
38 .B >
39 .I disk
40 .PP
41 .B vftp
42 .I score
43 |
44 .I disk
45 .PP
46 .B vmount
47 [
48 .B -v
49 ]
50 .I addr
51 .I mtpt
52 .PP
53 .B vnfs
54 [
55 .B -ELLRVr
56 ]
57 [
58 .B -a
59 .I addr
60 ]
61 [
62 .B -b
63 .I blocksize
64 ]
65 [
66 .B -c
67 .I cachesize
68 ]
69 .I config
70 .SH DESCRIPTION
71 These programs back up and restore standard
72 Unix file system images stored in
73 .IR venti (8).
74 Images stored in
75 .I venti
76 are named by
77 .IR scores ,
78 which consist of a file system type followed
79 by a colon and forty hexadecimal digits, as in:
80 .IP
81 .EX
82 ffs:0123456789abcdef0123456789abcdef01234567
83 .EE
84 .PP
85 (The hexadecimal data is the SHA1 hash of the Venti
86 root block representing the file system image.)
87 .PP
88 These programs expect the environment variable
89 .B $venti
90 to be set to the network address of the Venti server to use
91 (for example,
92 .B yourhost
93 or
94 .BR tcp!yourhost!venti ).
95 .PP
96 .I Vbackup
97 copies the file system stored on
98 .I disk
99 to the Venti server and prints the
100 score for the newly-stored image.
101 The argument
102 .I disk
103 should be a disk or disk partition device
104 that would be appropriate to pass to
105 .IR mount (8).
106 .PP
107 The optional argument
108 .I score
109 is the score of a previous backup of the disk image.
110 If
111 .I score
112 is given,
113 .I vbackup
114 will not write to Venti any blocks that have not changed
115 since the previous backup.
116 This is only a speed optimization: since the blocks are already
117 stored on Venti they need not be sent to the Venti server again.
118 .PP
119 The options to
120 .I vbackup
121 are:
122 .TP
123 .B -D
124 Turn on debugging output.
125 .TP
126 .B -V
127 Trace interactions with Venti server.
128 .TP
129 .B -m \fIhost
130 .B -M \fImtpt
131 Set names used to construct the path in the
132 .B mount command.
133 The default
134 .I host
135 is the name returned by
136 .I sysname
137 (see
138 .IR getuser (3)).
139 The default
140 .I mtpt
141 is the place where
142 .I disk
143 is currently mounted.
144 .TP
145 Set backup mount point:
146 this name is also used in the printed
147 .B mount
148 command.
149 The default is the name returned by
150 .I sysname
151 (see
152 .IR getuser (3)).
153 .TP
154 .B -n
155 No-op mode: do not write any blocks to the server
156 .TP
157 .B -v
158 Print verbose output.
159 .TP
160 .B -w \fIn
161 Write parallelism: keep
162 .I n
163 writes to the server in progress at a time.
164 .TP
165 .B -s \fIsecs
166 Status interval: every
167 .I secs
168 seconds, print a line tracking progress of the backup.
169 .PD
170 .PP
171 When
172 .I vbackup
173 finishes, it prints a single line of the form
174 .IP
175 .EX
176 mount /\fIhost\fL/\fIyyyy\fL/\fImmdd\fL/\fImtpt\fL \fIscore\fL \fIyyyy\fL/\fImmdd\fL/\fIhhmm
177 .EE
178 .LP
179 This line is a valid configuration line for
180 .I vnfs
181 .RI ( q.v. ).
182 .I Mntpath
183 is the path on which
184 .I disk
185 is currently mounted.
186 .PP
187 .I Vcat
188 writes the named disk image to standard output.
189 Unused file system blocks are printed zeroed regardless
190 of their actual content.
191 .PP
192 By default,
193 .I vcat
194 will assume that its standard output is seekable
195 .RI ( i.e.,
196 it has been redirected to a file or disk)
197 and seek over unused blocks instead of writing to them.
198 The
199 .B -z
200 option causes
201 .I vcat
202 to zero unused blocks instead.
203 .PP
204 .I Vftp
205 presents an
206 .IR ftp (1)-like
207 interface to a physical or backed-up disk image.
208 It is used mainly for debugging.
209 Type
210 .B help
211 at the
212 .B vftp>
213 prompt for a list of commands.
214 .PP
215 .I Vmount
216 mounts the NFS service at the network connection
217 .I address
218 onto
219 .IR mountpoint .
220 On most operating systems,
221 .I vmount
222 must be run by the user
223 .BR root .
224 .PP
225 .I Vnfs
226 serves, using the
227 NFS version 3 protocol,
228 one or more disk images in a synthetic tree defined
229 by the configuration file
230 .IR config .
231 .I Vnfs
232 serves both NFS mount protocol
233 and NFS protocol
234 RPCs at
235 .IR addr
236 (default
237 .BR udp!*!nfs ).
238 The options are:
239 .TP
240 .B -E
241 Disable `encrypted' handles.
242 By default handles are encrypted with a random key to avoid
243 leaking information about the backed-up file systems.
244 If encryption is disabled, the NFS handles exposed to the client
245 may leak information about the root scores of the disks as well
246 as inode numbers.
247 .TP
248 .B -L
249 Local service only: serve only requests from the loopback interface (127.0.0.1).
250 .TP
251 .B -LL
252 Local service only, with paranoia: serve only requests from loopback,
253 and only from the first source port that sends a request.
254 This option is intended to be used to make sure that once the local
255 host has mounted the service, no other local users can access it.
256 .TP
257 .B -R
258 Print all NFS and NFS mount RPCs to standard error.
259 .TP
260 .B -V
261 Print all Venti transactions to standard error.
262 .TP
263 .BI -a " addr
264 Serve requests on
265 .IR addr
266 (see above).
267 .TP
268 .BI -b " blocksize
269 Set block size used by the in-memory venti block cache.
270 Must be as large as the maximum block size in any
271 file system mentioned in the configuration.
272 .TP
273 .BI -c " cachesize
274 Set the number of blocks stored by the in-memory venti cache.
275 .TP
276 .B -r
277 Respond to all requests with a Sun RPC rejection.
278 This is useful during debugging.
279 .PD
280 .PP
281 .I Config
282 is a text file describing the
283 backup hierarchy for
284 .I vnfs
285 to serve.
286 Lines beginning with a sharp
287 .RB ( # )
288 are ignored.
289 The rest of the file is a sequence of commands, one per line.
290 The commands are:
291 .TP
292 .BI mount " mtpt score time
293 Add the file system with the given
294 .I score
295 to the tree at the mount point
296 .IR mtpt .
297 The path to the mount point will be created
298 if necessary.
299 If
300 .B /dev/null
301 is given as the score, an empty file system is mounted at
302 .IR mtpt ,
303 excluding
304 .IR mtpt 's
305 contents from view.
306 .I Time
307 is the modification time to return for the directory
308 .IR mtpt ,
309 either a decimal number of seconds since the epoch
310 or a string of the form
311 .IB yyyy / mmdd / hhmm
312 giving the year, month, day, hour, and minute.
313 .RI ( Vnfs
314 does not use the modification time of the root in order
315 to avoid accessing every mounted file system on common
316 actions like
317 .B ls
318 .B -l
319 .BR /dump/sys/2005 .)
320 .TP
321 .BI allow " ip\fR[\fL/\fImask\fR]
322 .TP
323 .BI deny " ip\fR[\fL/\fImask\fR]
324 These two commands define access permissions based on IP address.
325 The optional
326 .I mask
327 can be a decimal number (24) or an equivalent IP mask (255.255.255.0).
328 Each request is filtered through the rules listed in the configuration file.
329 The first rule that matches is used.
330 If any
331 .B allow
332 or
333 .B deny
334 rules are given, the default action is to reject the request.
335 In the absence of any rules, the default action is to accept all requests.
336 .PD
337 .SH EXAMPLES
338 .PP
339 Running on the server
340 .IR bob ,
341 back up the file system stored on
342 .BR /dev/da0s1a ,
343 which is mounted on
344 .BR /home :
345 .IP
346 .EX
347 % vbackup /dev/da0s1a
348 mount /bob/2005/0510/home ffs:0123456789abcdef\fI...\fP 2005/0510/0831
350 .EE
351 .PP
352 Serve that backup and a few others in a tree reminiscent
353 of Plan 9's dump file system, but hide each day's contents of
354 .B /tmp :
355 .IP
356 .EX
357 % cat config
358 mount /bob/2005/0510 ffs:0123456789abcdef\fI...\fP 2005/0510/0829
359 mount /bob/2005/0510/home ffs:0123456789abcdef\fI...\fP 2005/0510/0831
360 mount /bob/2005/0510/tmp /dev/null 1
361 mount /bob/2005/0511 ffs:0123456789abcdef\fI...\fP 2005/0511/0827
362 mount /bob/2005/0511/home ffs:0123456789abcdef\fI...\fP 2005/0511/0828
363 mount /bob/2005/0511/tmp /dev/null 1
364 % vnfs -b 16k -c 1k config
366 .EE
367 .PP
368 Mount the backups on a client machine using
369 .IR vmount :
370 .IP
371 .EX
372 # vmount udp!yourserver!nfs /dump
373 # ls /dump/bob/2005
374 0510
375 0511
377 .EE
378 .PP
379 (Users of fancy shells may need to quote the address argument.)