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