]> git.wh0rd.org - dump.git/blame_incremental - dump/dump.8.in
Configure magic for testing ext2_ino_t and s_journal_inum
[dump.git] / dump / dump.8.in
... / ...
CommitLineData
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.22 2001/03/20 20:15:43 stelian 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 e Ar inode number
48.Op Fl f Ar file
49.Op Fl F Ar script
50.Op Fl h Ar level
51.Op Fl L Ar label
52.Op Fl s Ar feet
53.Op Fl T Ar date
54.Op Fl z Ar compression level
55.Ar file-to-dump
56.Nm dump
57.Op Fl W Li \&| Fl w
58.Pp
59.in
60(The
61.Bx 4.3
62option syntax is implemented for backward compatibility but
63is not documented here.)
64.Sh DESCRIPTION
65.Nm Dump
66examines files
67on an ext2 filesystem
68and determines which files
69need to be backed up. These files
70are copied to the given disk, tape or other
71storage medium for safe keeping (see the
72.Fl f
73option below for doing remote backups).
74A dump that is larger than the output medium is broken into
75multiple volumes.
76On most media the size is determined by writing until an
77end-of-media indication is returned.
78.Pp
79On media that cannot reliably return an end-of-media indication
80(such as some cartridge tape drives), each volume is of a fixed size;
81the actual size is determined by specifying cartridge media, or via the
82tape size, density and/or block count options below.
83By default, the same output file name is used for each volume
84after prompting the operator to change media.
85.Pp
86.Ar file-to-dump
87is either a mountpoint of a filesystem
88or a directory to be backed up as a subset of a filesystem.
89In the former case, either the path to a mounted filesystem
90or the device of an unmounted filesystem can be used.
91In the latter case, certain restrictions are placed on the backup:
92.Fl u
93is not allowed and the only dump level that is supported is
94.Fl 0 .
95.Pp
96The following options are supported by
97.Nm Ns :
98.Bl -tag -width Ds
99.It Fl 0\-9
100Dump levels.
101A level 0, full backup,
102guarantees the entire file system is copied
103(but see also the
104.Fl h
105option below).
106A level number above 0,
107incremental backup,
108tells
109.Nm dump
110to
111copy all files new or modified since the
112last dump of a lower level.
113The default level is 9.
114.It Fl B Ar records
115The number of 1 KB blocks per volume.
116This option overrides the end-of-media detection, and calculation
117of tape size based on length and density.
118.It Fl a
119.Dq auto-size .
120Bypass all tape length calculations, and write
121until an end-of-media indication is returned. This works best
122for most modern tape drives, and is the default.
123Use of this option is particularly recommended when appending to an
124existing tape, or using a tape drive with hardware compression
125(where you can never be sure about the compression ratio).
126.It Fl b Ar blocksize
127The number of kilobytes per dump record.
128Since the IO system slices all requests into chunks of MAXBSIZE
129(typically 64KB), it is not possible to use a larger blocksize
130without having problems later with
131.Xr restore 8 .
132Therefore
133.Nm dump
134will constrain writes to MAXBSIZE.
135The default blocksize is 10.
136.It Fl c
137Change the defaults for use with a cartridge tape drive, with a density
138of 8000 bpi, and a length of 1700 feet. Specifying a cartridge drive
139overrides the end-of-media detection.
140.It Fl e Ar inode
141Exclude
142.Ar inode
143from the dump (you can use
144.Ar stat
145to find the inode number for a file or directory).
146.It Fl h Ar level
147Honor the user
148.Dq nodump
149flag
150.Dp Dv UF_NODUMP
151only for dumps at or above the given
152.Ar level .
153The default honor level is 1,
154so that incremental backups omit such files
155but full backups retain them.
156.It Fl d Ar density
157Set tape density to
158.Ar density .
159The default is 1600BPI. Specifying a tape density overrides the
160end-of-media detection.
161.It Fl f Ar file
162Write the backup to
163.Ar file ;
164.Ar file
165may be a special device file
166like
167.Pa /dev/st0
168(a tape drive),
169.Pa /dev/rsd1c
170(a floppy disk drive),
171an ordinary file,
172or
173.Ql Fl
174(the standard output).
175Multiple file names may be given as a single argument separated by commas.
176Each file will be used for one dump volume in the order listed;
177if the dump requires more volumes than the number of names given,
178the last file name will used for all remaining volumes after prompting
179for media changes.
180If the name of the file is of the form
181.Dq host:file
182or
183.Dq user@host:file
184.Nm
185writes to the named file on the remote host using
186.Xr rmt 8 .
187The default path name of the remote
188.Xr rmt 8
189program is
190.\" rmt path, is the path on the remote host
191.Pa /etc/rmt ;
192this can be overridden by the environment variable
193.Ev RMT .
194.It Fl F Ar script
195Run script at the end of each tape. The device name and the
196current volume number are passed on the command line.
197The script must return 0 if
198.Nm
199should continue without asking the user to change the tape, 1 if
200.Nm
201dump should continue but ask the user to change the tape.
202Any other exit code will cause
203.Nm
204to abort.
205For security reasons,
206.Nm
207reverts back to the real user ID and the real group ID before
208running the script.
209.It Fl k
210Use Kerberos authentication to talk to remote tape servers. (Only
211available if this option was enabled when
212.Nm
213was compiled.)
214.It Fl L Ar label
215The user-supplied text string
216.Ar label
217is placed into the dump header, where tools like
218.Xr restore 8
219and
220.Xr file 1
221can access it.
222Note that this label is limited
223to be at most LBLSIZE (currently 16) characters, which must include
224the terminating
225.Ql \e0 .
226.It Fl M
227Enable the multi-volume feature. The name specified with
228.Fl f
229is treated as a prefix and
230.Nm
231writes in sequence to <prefix>001, <prefix>002 etc. This can be
232useful when dumping to files on an ext2 partition, in order to bypass
233the 2GB file size limitation.
234.It Fl n
235Whenever
236.Nm
237requires operator attention,
238notify all operators in the group
239.Dq operator
240by means similar to a
241.Xr wall 1 .
242.It Fl s Ar feet
243Attempt to calculate the amount of tape needed at a particular density.
244If this amount is exceeded,
245.Nm
246prompts for a new tape.
247It is recommended to be a bit conservative on this option.
248The default tape length is 2300 feet. Specifying the tape size
249overrides end-of-media detection.
250.ne 1i
251.It Fl S
252Size estimate. Determine the amount of space
253that is needed to perform the dump without
254actually doing it, and display the estimated
255number of bytes it will take. This is useful
256with incremental dumps to determine how many
257volumes of media will be needed.
258.It Fl T Ar date
259Use the specified date as the starting time for the dump
260instead of the time determined from looking in
261.Pa __DUMPDATES__ .
262The format of
263.Ar date
264is the same as that of
265.Xr ctime 3 .
266This option is useful for automated dump scripts that wish to
267dump over a specific period of time.
268The
269.Fl T
270option is mutually exclusive from the
271.Fl u
272option.
273.It Fl u
274Update the file
275.Pa __DUMPDATES__
276after a successful dump.
277The format of
278.Pa __DUMPDATES__
279is readable by people, consisting of one
280free format record per line:
281filesystem name,
282increment level
283and
284.Xr ctime 3
285format dump date.
286There may be only one entry per filesystem at each level.
287The file
288.Pa __DUMPDATES__
289may be edited to change any of the fields,
290if necessary.
291.It Fl W
292.Nm Dump
293tells the operator what file systems need to be dumped.
294This information is gleaned from the files
295.Pa __DUMPDATES__
296and
297.Pa /etc/fstab .
298The
299.Fl W
300option causes
301.Nm
302to print out, for all file systems in
303.Pa __DUMPDATES__ ,
304and regognized file systems in
305.Pa /etc/fstab .
306the most recent dump date and level,
307and highlights those that should be dumped.
308If the
309.Fl W
310option is set, all other options are ignored, and
311.Nm
312exits immediately.
313.It Fl w
314Is like
315.Fl W ,
316but prints only recognized filesystems in
317.Pa /etc/fstab
318which need to be dumped.
319.It Fl z Ar compression level
320Compress every block to be written on the tape using zlib library. This
321option will work only when dumping to a file or pipe or, when dumping
322to a tape drive, if the tape drive is capable of writing variable
323length blocks. You will need at least the 0.4b22 version of restore in
324order to extract compressed tapes. Tapes written using compression will
325not be compatible with the BSD tape format. The (optional) parameter
326specifies the compression level zlib will use. The default compression
327level is 2.
328.El
329.Pp
330.Nm Dump
331requires operator intervention on these conditions:
332end of tape,
333end of dump,
334tape write error,
335tape open error or
336disk read error (if there is more than a threshold of 32).
337In addition to alerting all operators implied by the
338.Fl n
339key,
340.Nm
341interacts with the operator on
342.Em dump's
343control terminal at times when
344.Nm
345can no longer proceed,
346or if something is grossly wrong.
347All questions
348.Nm
349poses
350.Em must
351be answered by typing
352.Dq yes
353or
354.Dq no ,
355appropriately.
356.Pp
357Since making a dump involves a lot of time and effort for full dumps,
358.Nm
359checkpoints itself at the start of each tape volume.
360If writing that volume fails for some reason,
361.Nm
362will,
363with operator permission,
364restart itself from the checkpoint
365after the old tape has been rewound and removed,
366and a new tape has been mounted.
367.Pp
368.Nm Dump
369tells the operator what is going on at periodic intervals,
370including usually low estimates of the number of blocks to write,
371the number of tapes it will take, the time to completion, and
372the time to the tape change.
373The output is verbose,
374so that others know that the terminal
375controlling
376.Nm
377is busy,
378and will be for some time.
379.Pp
380In the event of a catastrophic disk event, the time required
381to restore all the necessary backup tapes or files to disk
382can be kept to a minimum by staggering the incremental dumps.
383An efficient method of staggering incremental dumps
384to minimize the number of tapes follows:
385.Bl -bullet -offset indent
386.It
387Always start with a level 0 backup, for example:
388.Bd -literal -offset indent
389/sbin/dump -0u -f /dev/st0 /usr/src
390.Ed
391.Pp
392This should be done at set intervals, say once a month or once every two months,
393and on a set of fresh tapes that is saved forever.
394.It
395After a level 0, dumps of active file
396systems are taken on a daily basis,
397using a modified Tower of Hanoi algorithm,
398with this sequence of dump levels:
399.Bd -literal -offset indent
4003 2 5 4 7 6 9 8 9 9 ...
401.Ed
402.Pp
403For the daily dumps, it should be possible to use a fixed number of tapes
404for each day, used on a weekly basis.
405Each week, a level 1 dump is taken, and
406the daily Hanoi sequence repeats beginning with 3.
407For weekly dumps, another fixed set of tapes per dumped file system is
408used, also on a cyclical basis.
409.El
410.Pp
411After several months or so, the daily and weekly tapes should get
412rotated out of the dump cycle and fresh tapes brought in.
413.Sh ENVIRONMENT
414.Bl -tag -width Fl
415.It Ev TAPE
416If no -f option was specified,
417.Nm
418will use the device specified via
419.Ev TAPE
420as the dump device.
421.Ev TAPE
422may be of the form
423.Qq tapename ,
424.Qq host:tapename ,
425or
426.Qq user@host:tapename .
427.It Ev RMT
428The environment variable
429.Ev RMT
430will be used to determine the pathname of the remote
431.Xr rmt 8
432program.
433.It Ev RSH
434.Nm Dump
435uses the contents of this variable to determine the name of the
436remote shell command to use when doing remote backups (rsh, ssh etc.).
437If this variable is not set,
438.Xr rcmd 3
439will be used, but only root will be able to do remote backups.
440.Sh FILES
441.Bl -tag -width __DUMPDATES__ -compact
442.It Pa /dev/st0
443default tape unit to dump to
444.It Pa __DUMPDATES__
445dump date records
446.It Pa /etc/fstab
447dump table: file systems and frequency
448.It Pa /etc/group
449to find group
450.Em operator
451.El
452.Sh SEE ALSO
453.Xr fstab 5 ,
454.Xr restore 8 ,
455.Xr rmt 8
456.Sh DIAGNOSTICS
457Many, and verbose.
458.Pp
459.Nm Dump
460exits with zero status on success.
461Startup errors are indicated with an exit code of 1;
462abnormal termination is indicated with an exit code of 3.
463.Sh BUGS
464It might be considered a bug that this version of dump can only handle ext2
465filesystems. Specifically, it does not work with FAT filesystems.
466.Pp
467Fewer than 32 read errors on the filesystem are ignored. If noticing
468read errors is important, the output from dump can be parsed to look for lines
469that contain the text 'read error'.
470.Pp
471Each reel requires a new process, so parent processes for
472reels already written just hang around until the entire tape
473is written.
474.Pp
475It would be nice if
476.Nm
477knew about the dump sequence,
478kept track of the tapes scribbled on,
479told the operator which tape to mount when,
480and provided more assistance
481for the operator running
482.Xr restore .
483.Pp
484.Nm Dump
485cannot do remote backups without being run as root, due to its
486security history.
487Presently, it works if you set it setuid (like it used to be), but this
488might constitute a security risk. Note that you can set RSH to use
489a remote shell program instead.
490.Sh AUTHOR
491The
492.Nm dump/restore
493backup suit was ported to Linux's Second Extended File System
494by Remy Card <card@Linux.EU.Org>. He maintained the initial versions
495of dump (up and including 0.4b4, released in january 1997).
496.Pp
497Starting with 0.4b5, the new maintainer is Stelian Pop
498.br
499<pop@noos.fr>.
500.Sh AVAILABILITY
501The
502.Nm dump/restore
503backup suit is available from
504.br
505http://dump.sourceforge.net
506.Sh HISTORY
507A
508.Nm
509command appeared in
510.At v6 .