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