This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.0'.
[unix-history] / sbin / dump / dump.8
CommitLineData
15637ed4
RG
1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)dump.8 6.8 (Berkeley) 6/17/91
33.\"
78ed81a3 34.\" $Header: /b/source/CVS/src/sbin/dump/dump.8,v 1.3 1993/03/23 00:27:01 cgd Exp $
35.\"
15637ed4
RG
36.Dd June 17, 1991
37.Dt DUMP 8
38.Os BSD 4
39.Sh NAME
40.Nm dump
41.Nd filesystem backup
42.Sh SYNOPSIS
43.Nm dump
44.Op Cm 0123456789fusdWn Op Ar argument ...
45.Op Ar filesystem
46.Sh DESCRIPTION
47.Nm Dump
48examines files
49on a filesystem
50and determines which files
51need to be backed up. These files
52are copied to the given disk, tape or other
53storage medium for safe keeping (see
54.Xr rdump 8
55for
56remote backups) .
57A dump that is larger than the output medium is broken into
58multiple volumes of a fixed size;
59the actual size is determined by the tape size and density and/or
60block count options below.
61By default, the same output file name is used for each volume
62after prompting the operator to change media.
63.Pp
64The following options are supported by
65.Nm dump:
66.Bl -tag -width 4n
67.It Cm 0\-9
68Dump levels.
69A level 0, full backup,
70guarantees the entire file system is copied.
71A level number above 0,
72incremental backup,
73tells dump to
74copy all files new or modified since the
75last dump of the same or lower level. The default
76level is 9.
77.It Cm f Op Ar file
78Write the backup to
79.Ar file ;
80.Ar file
81may be a special device file
82like
83.Pa /dev/rmt12
84(a tape drive),
85.Pa /dev/rsd1c
86(an optical drive),
87an ordinary file,
88or
89.Ql Fl
90(the standard output).
91Multiple file names may be given as a single argument separated by commas.
92Each file will be used for one dump volume in the order listed;
93if the dump requires more volumes than the number of names given,
94the last file name will used for all remaining volumes after prompting
95for media changes.
96.It Cm d Ar density
97Set tape density to
98.Ar density .
99The default is 1600BPI.
100.It Cm n
101Whenever
102.Nm dump
103requires operator attention,
104notify all operators in the group
105.Dq operator
106by means similar to a
107.Xr wall 1 .
108.It Cm s Ar feet
109Attempt to caluculate the amount of tape needed
110at a particular density.
111If this amount is exceeded,
112.Nm dump
113prompts for a new tape.
114It is recommended to be a bit conservative on this option.
115The default tape length is 2300 feet.
116.It Cm B Ar blocks
117Set the size of the dump file to the specified number of 1024-byte blocks,
118superceding the tape size and density.
119.It Cm u
120Update the file
121.Pa /etc/dumpdates
122after a successful dump.
123The format of
124.Pa /etc/dumpdates
125is readable by people, consisting of one
126free format record per line:
127filesystem name,
128increment level
129and
130.Xr ctime 3
131format dump date.
132There may be only one entry per filesystem at each level.
133The file
134.Pa /etc/dumpdates
135may be edited to change any of the fields,
136if necessary.
137.It Cm W
138.Nm Dump
139tells the operator what file systems need to be dumped.
140This information is gleaned from the files
141.Pa /etc/dumpdates
142and
143.Pa /etc/fstab .
144The
145.Cm W
146option causes
147.Nm dump
148to print out, for each file system in
149.Pa /etc/dumpdates
150the most recent dump date and level,
151and highlights those file systems that should be dumped.
152If the
153.Cm W
154option is set, all other options are ignored, and
155.Nm dump
156exits immediately.
157.It Cm w
158Is like W, but prints only those filesystems which need to be dumped.
159.El
160.Pp
161.Nm Dump
162requires operator intervention on these conditions:
163end of tape,
164end of dump,
165tape write error,
166tape open error or
167disk read error (if there are more than a threshold of 32).
168In addition to alerting all operators implied by the
169.Cm n
170key,
171.Nm dump
172interacts with the operator on
173.Em dump's
174control terminal at times when
175.Nm dump
176can no longer proceed,
177or if something is grossly wrong.
178All questions
179.Nm dump
180poses
181.Em must
182be answered by typing \*(lqyes\*(rq or \*(lqno\*(rq,
183appropriately.
184.Pp
185Since making a dump involves a lot of time and effort for full dumps,
186.Nm dump
187checkpoints itself at the start of each tape volume.
188If writing that volume fails for some reason,
189.Nm dump
190will,
191with operator permission,
192restart itself from the checkpoint
193after the old tape has been rewound and removed,
194and a new tape has been mounted.
195.Pp
196.Nm Dump
197tells the operator what is going on at periodic intervals,
198including usually low estimates of the number of blocks to write,
199the number of tapes it will take, the time to completion, and
200the time to the tape change.
201The output is verbose,
202so that others know that the terminal
203controlling
204.Nm dump
205is busy,
206and will be for some time.
207.Pp
208In the event of a catastrophic disk event, the time required
209to restore all the necessary backup tapes or files to disk
210can be kept to a minimum by staggering the incremental dumps.
211An efficient method of staggering incremental dumps
212to minimize the number of tapes follows:
213.Bl -bullet -offset indent
214.It
215Always start with a level 0 backup, for example:
216.Bd -literal -offset indent
217/etc/dump 0ufds /dev/nrst1 54000 6000 /usr/src
218.Ed
219.Pp
220This should be done at set intervals, say once a month or once every two months,
221and on a set of fresh tapes that is saved forever.
222.It
223After a level 0, dumps of active file
224systems are taken on a daily basis,
225using a modified Tower of Hanoi algorithm,
226with this sequence of dump levels:
227.Bd -literal -offset indent
2283 2 5 4 7 6 9 8 9 9 ...
229.Ed
230.Pp
231For the daily dumps, it should be possible to use a fixed number of tapes
232for each day, used on a weekly basis.
233Each week, a level 1 dump is taken, and
234the daily Hanoi sequence repeats beginning with 3.
235For weekly dumps, another fixed set of tapes per dumped file system is
236used, also on a cyclical basis.
237.El
238.Pp
239After several months or so, the daily and weekly tapes should get
240rotated out of the dump cycle and fresh tapes brought in.
241.Sh FILES
242.Bl -tag -width /etc/dumpdates -compact
243.It Pa /dev/rrp1g
244default filesystem to dump from (system dependent).
245.It Pa /dev/rmt8
246default tape unit to dump to
247.It Pa /etc/dumpdates
248new format dump date record
249.It Pa /etc/fstab
250dump table: file systems and frequency
251.It Pa /etc/group
252to find group
253.Em operator
254.El
255.Sh SEE ALSO
256.Xr rdump 8 ,
257.Xr restore 8 ,
258.Xr dump 5 ,
259.Xr fstab 5
260.Sh DIAGNOSTICS
261Many, and verbose.
262.Pp
263Dump exits with zero status on success.
264Startup errors are indicated with an exit code of 1;
265abnormal termination is indicated with an exit code of 3.
266.Sh BUGS
267.Pp
268Fewer than 32 read errors on the filesystem are ignored.
269Each reel requires a new process, so parent processes for
270reels already written just hang around until the entire tape
271is written.
272.Pp
273.Nm Dump
274with the
275.Cm W
276or
277.Cm w
278options does not report filesystems that have never been recorded
279in
280.Pa /etc/dumpdates ,
281even if listed in
282.Pa /etc/fstab .
283.Pp
284It would be nice if
285.Nm dump
286knew about the dump sequence,
287kept track of the tapes scribbled on,
288told the operator which tape to mount when,
289and provided more assistance
290for the operator running
291.Xr restore .
292.Sh HISTORY
293A
294.Nm
295command appeared in Version 6 AT&T UNIX.