]> git.wh0rd.org - dump.git/blob - dump/dump.8.in
Small dump man page fix.
[dump.git] / dump / dump.8.in
1 .\" Copyright (c) 1980, 1991, 1993
2 .\" Regents of the University of California.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by the University of
16 .\" California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\" $Id: dump.8.in,v 1.7 1999/12/06 21:37:50 tiniou Exp $
34 .\"
35 .Dd __DATE__
36 .Dt DUMP 8
37 .Os "dump __VERSION__"
38 .Sh NAME
39 .Nm dump
40 .Nd ext2 filesystem backup
41 .Sh SYNOPSIS
42 .Nm dump
43 .Op Fl 0123456789ackMnSu
44 .Op Fl B Ar records
45 .Op Fl b Ar blocksize
46 .Op Fl d Ar density
47 .Op Fl f Ar file
48 .Op Fl h Ar level
49 .Op Fl L Ar label
50 .Op Fl s Ar feet
51 .Op Fl T Ar date
52 .Ar filesystem
53 .Nm dump
54 .Op Fl 0123456789ackMnSu
55 .Op Fl B Ar records
56 .Op Fl b Ar blocksize
57 .Op Fl d Ar density
58 .Op Fl f Ar file
59 .Op Fl h Ar level
60 .Op Fl L Ar label
61 .Op Fl s Ar feet
62 .Op Fl T Ar date
63 .Ar directory
64 .Nm dump
65 .Op Fl W Li \&| Fl w
66 .Pp
67 .in
68 (The
69 .Bx 4.3
70 option syntax is implemented for backward compatibility but
71 is not documented here.)
72 .Sh DESCRIPTION
73 .Nm Dump
74 examines files
75 on an ext2 filesystem
76 and determines which files
77 need to be backed up. These files
78 are copied to the given disk, tape or other
79 storage medium for safe keeping (see the
80 .Fl f
81 option below for doing remote backups).
82 A dump that is larger than the output medium is broken into
83 multiple volumes.
84 On most media the size is determined by writing until an
85 end-of-media indication is returned. This can be enforced
86 by using the
87 .Fl a
88 option.
89 .Pp
90 On media that cannot reliably return an end-of-media indication
91 (such as some cartridge tape drives),
92 each volume is of a fixed size;
93 the actual size is determined by the tape size, density and/or
94 block count options below.
95 By default, the same output file name is used for each volume
96 after prompting the operator to change media.
97 .Pp
98 The following options are supported by
99 .Nm Ns :
100 .Bl -tag -width Ds
101 .It Fl 0\-9
102 Dump levels.
103 A level 0, full backup,
104 guarantees the entire file system is copied
105 (but see also the
106 .Fl h
107 option below).
108 A level number above 0,
109 incremental backup,
110 tells
111 .Nm dump
112 to
113 copy all files new or modified since the
114 last dump of a lower level.
115 The default level is 9.
116 .It Fl B Ar records
117 The number of 1 KB blocks per volume.
118 This option overrides the calculation of tape size
119 based on length and density.
120 .It Fl a
121 .Dq auto-size .
122 Bypass all tape length considerations, and enforce writing
123 until an end-of-media indication is returned. This fits best
124 for most modern tape drives. Use of this option is particularly
125 recommended when appending to an existing tape, or using a tape
126 drive with hardware compression (where you can never be sure about
127 the compression ratio).
128 .It Fl b Ar blocksize
129 The number of kilobytes per dump record.
130 Since the IO system slices all requests into chunks of MAXBSIZE
131 (typically 64KB), it is not possible to use a larger blocksize
132 without having problems later with
133 .Xr restore 8 .
134 Therefore
135 .Nm dump
136 will constrain writes to MAXBSIZE.
137 .It Fl c
138 Change the defaults for use with a cartridge tape drive, with a density
139 of 8000 bpi, and a length of 1700 feet.
140 .It Fl h Ar level
141 Honor the user
142 .Dq nodump
143 flag
144 .Dp Dv UF_NODUMP
145 only for dumps at or above the given
146 .Ar level .
147 The default honor level is 1,
148 so that incremental backups omit such files
149 but full backups retain them.
150 .It Fl d Ar density
151 Set tape density to
152 .Ar density .
153 The default is 1600BPI.
154 .It Fl f Ar file
155 Write the backup to
156 .Ar file ;
157 .Ar file
158 may be a special device file
159 like
160 .Pa /dev/st0
161 (a tape drive),
162 .Pa /dev/rsd1c
163 (a floppy disk drive),
164 an ordinary file,
165 or
166 .Ql Fl
167 (the standard output).
168 Multiple file names may be given as a single argument separated by commas.
169 Each file will be used for one dump volume in the order listed;
170 if the dump requires more volumes than the number of names given,
171 the last file name will used for all remaining volumes after prompting
172 for media changes.
173 If the name of the file is of the form
174 .Dq host:file
175 or
176 .Dq user@host:file
177 .Nm
178 writes to the named file on the remote host using
179 .Xr rmt 8 .
180 The default path name of the remote
181 .Xr rmt 8
182 program is
183 .\" rmt path, is the path on the remote host
184 .Pa /etc/rmt ;
185 this can be overridden by the environment variable
186 .Ev RMT .
187 .It Fl k
188 Use Kerberos authentication to talk to remote tape servers. (Only
189 available if this option was enabled when
190 .Nm
191 was compiled.)
192 .It Fl L Ar label
193 The user-supplied text string
194 .Ar label
195 is placed into the dump header, where tools like
196 .Xr restore 8
197 and
198 .Xr file 1
199 can access it.
200 Note that this label is limited
201 to be at most LBLSIZE (currently 16) characters, which must include
202 the terminating
203 .Ql \e0 .
204 .It Fl M
205 Enable the multi-volume feature. The name specified with
206 .Fl f
207 is treated as a prefix and
208 .Nm
209 writes in sequence to <prefix>001, <prefix>002 etc. This can be
210 useful when dumping to files on an ext2 partition, in order to bypass
211 the 2GB file size limitation.
212 .It Fl n
213 Whenever
214 .Nm
215 requires operator attention,
216 notify all operators in the group
217 .Dq operator
218 by means similar to a
219 .Xr wall 1 .
220 .It Fl s Ar feet
221 Attempt to calculate the amount of tape needed
222 at a particular density.
223 If this amount is exceeded,
224 .Nm
225 prompts for a new tape.
226 It is recommended to be a bit conservative on this option.
227 The default tape length is 2300 feet.
228 .ne 1i
229 .It Fl S
230 Size estimate. Determine the amount of space
231 that is needed to perform the dump without
232 actually doing it, and display the estimated
233 number of blocks it will take. This is useful
234 with incremental dumps to determine how many
235 volumes of media will be needed.
236 .It Fl T Ar date
237 Use the specified date as the starting time for the dump
238 instead of the time determined from looking in
239 .Pa __DUMPDATES__ .
240 The format of
241 .Ar date
242 is the same as that of
243 .Xr ctime 3 .
244 This option is useful for automated dump scripts that wish to
245 dump over a specific period of time.
246 The
247 .Fl T
248 option is mutually exclusive from the
249 .Fl u
250 option.
251 .It Fl u
252 Update the file
253 .Pa __DUMPDATES__
254 after a successful dump.
255 The format of
256 .Pa __DUMPDATES__
257 is readable by people, consisting of one
258 free format record per line:
259 filesystem name,
260 increment level
261 and
262 .Xr ctime 3
263 format dump date.
264 There may be only one entry per filesystem at each level.
265 The file
266 .Pa __DUMPDATES__
267 may be edited to change any of the fields,
268 if necessary.
269 .It Fl W
270 .Nm Dump
271 tells the operator what file systems need to be dumped.
272 This information is gleaned from the files
273 .Pa __DUMPDATES__
274 and
275 .Pa /etc/fstab .
276 The
277 .Fl W
278 option causes
279 .Nm
280 to print out, for each file system in
281 .Pa __DUMPDATES__ ,
282 the most recent dump date and level,
283 and highlights those file systems that should be dumped.
284 If the
285 .Fl W
286 option is set, all other options are ignored, and
287 .Nm
288 exits immediately.
289 .It Fl w
290 Is like
291 .Fl W ,
292 but prints only those filesystems which need to be dumped.
293 .El
294 .Pp
295 .Nm Dump
296 requires operator intervention on these conditions:
297 end of tape,
298 end of dump,
299 tape write error,
300 tape open error or
301 disk read error (if there is more than a threshold of 32).
302 In addition to alerting all operators implied by the
303 .Fl n
304 key,
305 .Nm
306 interacts with the operator on
307 .Em dump's
308 control terminal at times when
309 .Nm
310 can no longer proceed,
311 or if something is grossly wrong.
312 All questions
313 .Nm
314 poses
315 .Em must
316 be answered by typing
317 .Dq yes
318 or
319 .Dq no ,
320 appropriately.
321 .Pp
322 Since making a dump involves a lot of time and effort for full dumps,
323 .Nm
324 checkpoints itself at the start of each tape volume.
325 If writing that volume fails for some reason,
326 .Nm
327 will,
328 with operator permission,
329 restart itself from the checkpoint
330 after the old tape has been rewound and removed,
331 and a new tape has been mounted.
332 .Pp
333 .Nm Dump
334 tells the operator what is going on at periodic intervals,
335 including usually low estimates of the number of blocks to write,
336 the number of tapes it will take, the time to completion, and
337 the time to the tape change.
338 The output is verbose,
339 so that others know that the terminal
340 controlling
341 .Nm
342 is busy,
343 and will be for some time.
344 .Pp
345 In the event of a catastrophic disk event, the time required
346 to restore all the necessary backup tapes or files to disk
347 can be kept to a minimum by staggering the incremental dumps.
348 An efficient method of staggering incremental dumps
349 to minimize the number of tapes follows:
350 .Bl -bullet -offset indent
351 .It
352 Always start with a level 0 backup, for example:
353 .Bd -literal -offset indent
354 /sbin/dump -0u -f /dev/st0 /usr/src
355 .Ed
356 .Pp
357 This should be done at set intervals, say once a month or once every two months,
358 and on a set of fresh tapes that is saved forever.
359 .It
360 After a level 0, dumps of active file
361 systems are taken on a daily basis,
362 using a modified Tower of Hanoi algorithm,
363 with this sequence of dump levels:
364 .Bd -literal -offset indent
365 3 2 5 4 7 6 9 8 9 9 ...
366 .Ed
367 .Pp
368 For the daily dumps, it should be possible to use a fixed number of tapes
369 for each day, used on a weekly basis.
370 Each week, a level 1 dump is taken, and
371 the daily Hanoi sequence repeats beginning with 3.
372 For weekly dumps, another fixed set of tapes per dumped file system is
373 used, also on a cyclical basis.
374 .El
375 .Pp
376 After several months or so, the daily and weekly tapes should get
377 rotated out of the dump cycle and fresh tapes brought in.
378 .Sh ENVIRONMENT
379 .Bl -tag -width Fl
380 .It Ev TAPE
381 If no -f option was specified,
382 .Nm
383 will use the device specified via
384 .Ev TAPE
385 as the dump device.
386 .Ev TAPE
387 may be of the form
388 .Qq tapename ,
389 .Qq host:tapename ,
390 or
391 .Qq user@host:tapename .
392 .It Ev RMT
393 The environment variable
394 .Ev RMT
395 will be used to determine the pathname of the remote
396 .Xr rmt 8
397 program.
398 .It Ev RSH
399 .Nm Dump
400 uses the contents of this variable to determine the name of the
401 remote shell command to use when doing remote backups (rsh, ssh etc.).
402 If this variable is not set,
403 .Xr rcmd 3
404 will be used, but only root will be able to do remote backups.
405 .Sh FILES
406 .Bl -tag -width __DUMPDATES__ -compact
407 .It Pa /dev/st0
408 default tape unit to dump to
409 .It Pa __DUMPDATES__
410 dump date records
411 .It Pa /etc/fstab
412 dump table: file systems and frequency
413 .It Pa /etc/group
414 to find group
415 .Em operator
416 .El
417 .Sh SEE ALSO
418 .Xr fstab 5 ,
419 .Xr restore 8 ,
420 .Xr rmt 8
421 .Sh DIAGNOSTICS
422 Many, and verbose.
423 .Pp
424 .Nm Dump
425 exits with zero status on success.
426 Startup errors are indicated with an exit code of 1;
427 abnormal termination is indicated with an exit code of 3.
428 .Sh BUGS
429 It might be considered a bug that this version of dump can only handle ext2
430 filesystems. Specifically, it does not work with FAT filesystems.
431 .Pp
432 Fewer than 32 read errors on the filesystem are ignored. If noticing
433 read errors is important, the output from dump can be parsed to look for lines
434 that contain the text 'read error'.
435 .Pp
436 Each reel requires a new process, so parent processes for
437 reels already written just hang around until the entire tape
438 is written.
439 .Pp
440 .Nm Dump
441 with the
442 .Fl W
443 or
444 .Fl w
445 option does not report filesystems that have never been recorded
446 in
447 .Pa __DUMPDATES__ ,
448 even if listed in
449 .Pa /etc/fstab .
450 .Pp
451 It would be nice if
452 .Nm
453 knew about the dump sequence,
454 kept track of the tapes scribbled on,
455 told the operator which tape to mount when,
456 and provided more assistance
457 for the operator running
458 .Xr restore .
459 .Pp
460 .Nm Dump
461 cannot do remote backups without being run as root, due to its
462 security history.
463 Presently, it works if you set it setuid (like it used to be), but this
464 might constitute a security risk. Note that you can set RSH to use
465 a remote shell program instead.
466 .Sh AUTHOR
467 The
468 .Nm dump/restore
469 backup suit was ported to Linux's Second Extended File System
470 by Remy Card <card@Linux.EU.Org>. He maintained the initial versions
471 of dump (up and including 0.4b4, released in january 1997).
472 .Pp
473 Starting with 0.4b5, the new maintainer is Stelian Pop
474 .br
475 <pop@cybercable.fr>.
476 .Sh AVAILABILITY
477 The
478 .Nm dump/restore
479 backup suit is available for anonymous ftp from tsx-11.mit.edu
480 in /pub/linux/ALPHA/ext2fs (development versions) or
481 /pub/linux/packages/ext2fs (stable versions).
482 .Pp
483 An alternate downloading location is http://perso.cybercable.fr/pop/dump.
484 .Sh HISTORY
485 A
486 .Nm
487 command appeared in
488 .At v6 .