BSD 4_4_Lite2 release
[unix-history] / usr / src / sbin / dump / dump.8
CommitLineData
ad787160
C
1.\" Copyright (c) 1980, 1991, 1993
2.\" Regents of the University of California.
0fccfdb8 3.\" All rights reserved.
89f26d46 4.\"
ad787160
C
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.
89f26d46 20.\"
ad787160
C
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.
0fccfdb8 32.\"
fd88f5c5 33.\" @(#)dump.8 8.3 (Berkeley) 5/1/95
ad787160 34.\"
fd88f5c5 35.Dd May 1, 1995
0fccfdb8
CL
36.Dt DUMP 8
37.Os BSD 4
38.Sh NAME
39.Nm dump
40.Nd filesystem backup
41.Sh SYNOPSIS
42.Nm dump
6f80b439
KM
43.Op Fl 0123456789cnu
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 s Ar feet
50.Op Fl T Ar date
51.Ar filesystem
52.Nm dump
53.Op Fl W Li \&| Fl w
54.Pp
55.in -\\n(iSu
56(The
57.Bx 4.3
58option syntax is implemented for backward compatibility, but
59is not documented here.)
0fccfdb8
CL
60.Sh DESCRIPTION
61.Nm Dump
62examines files
63on a filesystem
64and determines which files
65need to be backed up. These files
66are copied to the given disk, tape or other
04342a85 67storage medium for safe keeping (see the
6f80b439 68.Fl f
04342a85 69option below for doing remote backups).
d4e7a13d 70A dump that is larger than the output medium is broken into
04342a85
KM
71multiple volumes.
72On most media the size is determined by writing until an
73end-of-media indication is returned.
74On media that cannot reliably return an end-of-media indication
75(such as some cartridge tape drives)
76each volume is of a fixed size;
d4e7a13d
MK
77the actual size is determined by the tape size and density and/or
78block count options below.
79By default, the same output file name is used for each volume
80after prompting the operator to change media.
0fccfdb8
CL
81.Pp
82The following options are supported by
6f80b439
KM
83.Nm dump :
84.Bl -tag -width Ds
85.It Fl 0\-9
0fccfdb8
CL
86Dump levels.
87A level 0, full backup,
68979611
CT
88guarantees the entire file system is copied
89(but see also the
6f80b439 90.Fl h
68979611 91option below).
0fccfdb8
CL
92A level number above 0,
93incremental backup,
94tells dump to
95copy all files new or modified since the
6f80b439
KM
96last dump of the same or lower level.
97The default level is 9.
98.It Fl B Ar records
ad787160
C
99The number of dump records per volume.
100This option overrides the calculation of tape size
101based on length and density.
6f80b439 102.It Fl b Ar blocksize
ad787160 103The number of kilobytes per dump record.
6f80b439
KM
104.It Fl c
105Modify the calculation of the default density and tape size to be more
106appropriate for cartridge tapes.
107.It Fl d Ar density
108Set tape density to
109.Ar density .
110The default is 1600BPI.
111.It Fl f Ar file
0fccfdb8
CL
112Write the backup to
113.Ar file ;
114.Ar file
115may be a special device file
116like
117.Pa /dev/rmt12
118(a tape drive),
119.Pa /dev/rsd1c
04342a85 120(a disk drive),
0fccfdb8
CL
121an ordinary file,
122or
123.Ql Fl
124(the standard output).
d4e7a13d
MK
125Multiple file names may be given as a single argument separated by commas.
126Each file will be used for one dump volume in the order listed;
127if the dump requires more volumes than the number of names given,
128the last file name will used for all remaining volumes after prompting
129for media changes.
04342a85
KM
130If the name of the file is of the form
131.Dq host:file ,
38b54c01
KM
132or
133.Dq user@host:file ,
04342a85
KM
134.Nm dump
135writes to the named file on the remote host using
136.Xr rmt 8 .
6f80b439
KM
137.It Fl h Ar level
138Honor the user
139.Dq nodump
140flag
141.Dp Dv UF_NODUMP
142only for dumps at or above the given
143.Ar level .
144The default honor level is 1,
145so that incremental backups omit such files
146but full backups retain them.
147.It Fl n
0fccfdb8
CL
148Whenever
149.Nm dump
150requires operator attention,
151notify all operators in the group
152.Dq operator
153by means similar to a
154.Xr wall 1 .
6f80b439 155.It Fl s Ar feet
b3938c76 156Attempt to calculate the amount of tape needed
0fccfdb8
CL
157at a particular density.
158If this amount is exceeded,
159.Nm dump
fbe2138c
KB
160prompts for a new tape.
161It is recommended to be a bit conservative on this option.
162The default tape length is 2300 feet.
2e55f625 163.ne 1i
6f80b439
KM
164.It Fl T Ar date
165Use the specified date as the starting time for the dump
166instead of the time determined from looking in
167.Pa /etc/dumpdates .
168The format of date is the same as that of
169.Xr ctime 3 .
170This option is useful for automated dump scripts that wish to
171dump over a specific period of time.
172The
173.Fl T
174option is mutually exclusive from the
175.Fl u
176option.
177.It Fl u
0fccfdb8
CL
178Update the file
179.Pa /etc/dumpdates
180after a successful dump.
89f26d46 181The format of
0fccfdb8 182.Pa /etc/dumpdates
89f26d46
KM
183is readable by people, consisting of one
184free format record per line:
0fccfdb8
CL
185filesystem name,
186increment level
89f26d46 187and
0fccfdb8 188.Xr ctime 3
04342a85 189format dump date.
0fccfdb8
CL
190There may be only one entry per filesystem at each level.
191The file
192.Pa /etc/dumpdates
89f26d46
KM
193may be edited to change any of the fields,
194if necessary.
6f80b439 195.It Fl W
0fccfdb8 196.Nm Dump
89f26d46
KM
197tells the operator what file systems need to be dumped.
198This information is gleaned from the files
0fccfdb8 199.Pa /etc/dumpdates
89f26d46 200and
0fccfdb8 201.Pa /etc/fstab .
89f26d46 202The
6f80b439 203.Fl W
89f26d46 204option causes
0fccfdb8 205.Nm dump
89f26d46 206to print out, for each file system in
0fccfdb8 207.Pa /etc/dumpdates
89f26d46
KM
208the most recent dump date and level,
209and highlights those file systems that should be dumped.
04342a85 210If the
6f80b439 211.Fl W
89f26d46 212option is set, all other options are ignored, and
0fccfdb8 213.Nm dump
89f26d46 214exits immediately.
6f80b439 215.It Fl w
89f26d46 216Is like W, but prints only those filesystems which need to be dumped.
0fccfdb8
CL
217.El
218.Pp
0fccfdb8 219.Nm Dump
89f26d46
KM
220requires operator intervention on these conditions:
221end of tape,
222end of dump,
223tape write error,
224tape open error or
225disk read error (if there are more than a threshold of 32).
226In addition to alerting all operators implied by the
6f80b439 227.Fl n
89f26d46 228key,
0fccfdb8 229.Nm dump
04342a85 230interacts with the operator on
0fccfdb8 231.Em dump's
89f26d46 232control terminal at times when
0fccfdb8 233.Nm dump
89f26d46
KM
234can no longer proceed,
235or if something is grossly wrong.
236All questions
0fccfdb8 237.Nm dump
89f26d46 238poses
0fccfdb8 239.Em must
04342a85
KM
240be answered by typing
241.Dq yes
242or
243.Dq no ,
89f26d46 244appropriately.
0fccfdb8 245.Pp
89f26d46 246Since making a dump involves a lot of time and effort for full dumps,
0fccfdb8 247.Nm dump
89f26d46
KM
248checkpoints itself at the start of each tape volume.
249If writing that volume fails for some reason,
0fccfdb8 250.Nm dump
89f26d46
KM
251will,
252with operator permission,
253restart itself from the checkpoint
254after the old tape has been rewound and removed,
255and a new tape has been mounted.
0fccfdb8
CL
256.Pp
257.Nm Dump
89f26d46
KM
258tells the operator what is going on at periodic intervals,
259including usually low estimates of the number of blocks to write,
260the number of tapes it will take, the time to completion, and
261the time to the tape change.
262The output is verbose,
263so that others know that the terminal
264controlling
0fccfdb8 265.Nm dump
89f26d46
KM
266is busy,
267and will be for some time.
0fccfdb8
CL
268.Pp
269In the event of a catastrophic disk event, the time required
270to restore all the necessary backup tapes or files to disk
271can be kept to a minimum by staggering the incremental dumps.
272An efficient method of staggering incremental dumps
273to minimize the number of tapes follows:
274.Bl -bullet -offset indent
275.It
276Always start with a level 0 backup, for example:
277.Bd -literal -offset indent
6f80b439 278/sbin/dump -0u -f /dev/nrst1 /usr/src
0fccfdb8
CL
279.Ed
280.Pp
281This should be done at set intervals, say once a month or once every two months,
282and on a set of fresh tapes that is saved forever.
283.It
04342a85 284After a level 0, dumps of active file
89f26d46
KM
285systems are taken on a daily basis,
286using a modified Tower of Hanoi algorithm,
287with this sequence of dump levels:
0fccfdb8 288.Bd -literal -offset indent
89f26d46 2893 2 5 4 7 6 9 8 9 9 ...
0fccfdb8
CL
290.Ed
291.Pp
292For the daily dumps, it should be possible to use a fixed number of tapes
293for each day, used on a weekly basis.
89f26d46 294Each week, a level 1 dump is taken, and
0fccfdb8
CL
295the daily Hanoi sequence repeats beginning with 3.
296For weekly dumps, another fixed set of tapes per dumped file system is
89f26d46 297used, also on a cyclical basis.
0fccfdb8
CL
298.El
299.Pp
300After several months or so, the daily and weekly tapes should get
301rotated out of the dump cycle and fresh tapes brought in.
302.Sh FILES
303.Bl -tag -width /etc/dumpdates -compact
0fccfdb8
CL
304.It Pa /dev/rmt8
305default tape unit to dump to
306.It Pa /etc/dumpdates
04342a85 307dump date records
0fccfdb8
CL
308.It Pa /etc/fstab
309dump table: file systems and frequency
310.It Pa /etc/group
311to find group
312.Em operator
313.El
314.Sh SEE ALSO
0fccfdb8 315.Xr restore 8 ,
04342a85 316.Xr rmt 8 ,
0fccfdb8
CL
317.Xr dump 5 ,
318.Xr fstab 5
319.Sh DIAGNOSTICS
89f26d46 320Many, and verbose.
0fccfdb8 321.Pp
5d9a2c90
KM
322Dump exits with zero status on success.
323Startup errors are indicated with an exit code of 1;
324abnormal termination is indicated with an exit code of 3.
0fccfdb8 325.Sh BUGS
89f26d46 326Fewer than 32 read errors on the filesystem are ignored.
6f80b439 327.Pp
89f26d46
KM
328Each reel requires a new process, so parent processes for
329reels already written just hang around until the entire tape
330is written.
0fccfdb8
CL
331.Pp
332.Nm Dump
b3dfcea8 333with the
6f80b439 334.Fl W
b3dfcea8 335or
6f80b439 336.Fl w
b3dfcea8 337options does not report filesystems that have never been recorded
0fccfdb8
CL
338in
339.Pa /etc/dumpdates ,
340even if listed in
341.Pa /etc/fstab .
342.Pp
89f26d46 343It would be nice if
0fccfdb8 344.Nm dump
89f26d46
KM
345knew about the dump sequence,
346kept track of the tapes scribbled on,
347told the operator which tape to mount when,
348and provided more assistance
349for the operator running
0fccfdb8
CL
350.Xr restore .
351.Sh HISTORY
352A
04342a85 353.Nm dump
0fccfdb8 354command appeared in Version 6 AT&T UNIX.