adding GNU dc ("desk calculator")
[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.\"
34.Dd June 17, 1991
35.Dt DUMP 8
36.Os BSD 4
37.Sh NAME
38.Nm dump
39.Nd filesystem backup
40.Sh SYNOPSIS
41.Nm dump
42.Op Cm 0123456789fusdWn Op Ar argument ...
43.Op Ar filesystem
44.Sh DESCRIPTION
45.Nm Dump
46examines files
47on a filesystem
48and determines which files
49need to be backed up. These files
50are copied to the given disk, tape or other
51storage medium for safe keeping (see
52.Xr rdump 8
53for
54remote backups) .
55A dump that is larger than the output medium is broken into
56multiple volumes of a fixed size;
57the actual size is determined by the tape size and density and/or
58block count options below.
59By default, the same output file name is used for each volume
60after prompting the operator to change media.
61.Pp
62The following options are supported by
63.Nm dump:
64.Bl -tag -width 4n
65.It Cm 0\-9
66Dump levels.
67A level 0, full backup,
68guarantees the entire file system is copied.
69A level number above 0,
70incremental backup,
71tells dump to
72copy all files new or modified since the
73last dump of the same or lower level. The default
74level is 9.
75.It Cm f Op Ar file
76Write the backup to
77.Ar file ;
78.Ar file
79may be a special device file
80like
81.Pa /dev/rmt12
82(a tape drive),
83.Pa /dev/rsd1c
84(an optical drive),
85an ordinary file,
86or
87.Ql Fl
88(the standard output).
89Multiple file names may be given as a single argument separated by commas.
90Each file will be used for one dump volume in the order listed;
91if the dump requires more volumes than the number of names given,
92the last file name will used for all remaining volumes after prompting
93for media changes.
94.It Cm d Ar density
95Set tape density to
96.Ar density .
97The default is 1600BPI.
98.It Cm n
99Whenever
100.Nm dump
101requires operator attention,
102notify all operators in the group
103.Dq operator
104by means similar to a
105.Xr wall 1 .
106.It Cm s Ar feet
107Attempt to caluculate the amount of tape needed
108at a particular density.
109If this amount is exceeded,
110.Nm dump
111prompts for a new tape.
112It is recommended to be a bit conservative on this option.
113The default tape length is 2300 feet.
114.It Cm B Ar blocks
115Set the size of the dump file to the specified number of 1024-byte blocks,
116superceding the tape size and density.
117.It Cm u
118Update the file
119.Pa /etc/dumpdates
120after a successful dump.
121The format of
122.Pa /etc/dumpdates
123is readable by people, consisting of one
124free format record per line:
125filesystem name,
126increment level
127and
128.Xr ctime 3
129format dump date.
130There may be only one entry per filesystem at each level.
131The file
132.Pa /etc/dumpdates
133may be edited to change any of the fields,
134if necessary.
135.It Cm W
136.Nm Dump
137tells the operator what file systems need to be dumped.
138This information is gleaned from the files
139.Pa /etc/dumpdates
140and
141.Pa /etc/fstab .
142The
143.Cm W
144option causes
145.Nm dump
146to print out, for each file system in
147.Pa /etc/dumpdates
148the most recent dump date and level,
149and highlights those file systems that should be dumped.
150If the
151.Cm W
152option is set, all other options are ignored, and
153.Nm dump
154exits immediately.
155.It Cm w
156Is like W, but prints only those filesystems which need to be dumped.
157.El
158.Pp
159.Nm Dump
160requires operator intervention on these conditions:
161end of tape,
162end of dump,
163tape write error,
164tape open error or
165disk read error (if there are more than a threshold of 32).
166In addition to alerting all operators implied by the
167.Cm n
168key,
169.Nm dump
170interacts with the operator on
171.Em dump's
172control terminal at times when
173.Nm dump
174can no longer proceed,
175or if something is grossly wrong.
176All questions
177.Nm dump
178poses
179.Em must
180be answered by typing \*(lqyes\*(rq or \*(lqno\*(rq,
181appropriately.
182.Pp
183Since making a dump involves a lot of time and effort for full dumps,
184.Nm dump
185checkpoints itself at the start of each tape volume.
186If writing that volume fails for some reason,
187.Nm dump
188will,
189with operator permission,
190restart itself from the checkpoint
191after the old tape has been rewound and removed,
192and a new tape has been mounted.
193.Pp
194.Nm Dump
195tells the operator what is going on at periodic intervals,
196including usually low estimates of the number of blocks to write,
197the number of tapes it will take, the time to completion, and
198the time to the tape change.
199The output is verbose,
200so that others know that the terminal
201controlling
202.Nm dump
203is busy,
204and will be for some time.
205.Pp
206In the event of a catastrophic disk event, the time required
207to restore all the necessary backup tapes or files to disk
208can be kept to a minimum by staggering the incremental dumps.
209An efficient method of staggering incremental dumps
210to minimize the number of tapes follows:
211.Bl -bullet -offset indent
212.It
213Always start with a level 0 backup, for example:
214.Bd -literal -offset indent
215/etc/dump 0ufds /dev/nrst1 54000 6000 /usr/src
216.Ed
217.Pp
218This should be done at set intervals, say once a month or once every two months,
219and on a set of fresh tapes that is saved forever.
220.It
221After a level 0, dumps of active file
222systems are taken on a daily basis,
223using a modified Tower of Hanoi algorithm,
224with this sequence of dump levels:
225.Bd -literal -offset indent
2263 2 5 4 7 6 9 8 9 9 ...
227.Ed
228.Pp
229For the daily dumps, it should be possible to use a fixed number of tapes
230for each day, used on a weekly basis.
231Each week, a level 1 dump is taken, and
232the daily Hanoi sequence repeats beginning with 3.
233For weekly dumps, another fixed set of tapes per dumped file system is
234used, also on a cyclical basis.
235.El
236.Pp
237After several months or so, the daily and weekly tapes should get
238rotated out of the dump cycle and fresh tapes brought in.
239.Sh FILES
240.Bl -tag -width /etc/dumpdates -compact
241.It Pa /dev/rrp1g
242default filesystem to dump from (system dependent).
243.It Pa /dev/rmt8
244default tape unit to dump to
245.It Pa /etc/dumpdates
246new format dump date record
247.It Pa /etc/fstab
248dump table: file systems and frequency
249.It Pa /etc/group
250to find group
251.Em operator
252.El
253.Sh SEE ALSO
254.Xr rdump 8 ,
255.Xr restore 8 ,
256.Xr dump 5 ,
257.Xr fstab 5
258.Sh DIAGNOSTICS
259Many, and verbose.
260.Pp
261Dump exits with zero status on success.
262Startup errors are indicated with an exit code of 1;
263abnormal termination is indicated with an exit code of 3.
264.Sh BUGS
265.Pp
266Fewer than 32 read errors on the filesystem are ignored.
267Each reel requires a new process, so parent processes for
268reels already written just hang around until the entire tape
269is written.
270.Pp
271.Nm Dump
272with the
273.Cm W
274or
275.Cm w
276options does not report filesystems that have never been recorded
277in
278.Pa /etc/dumpdates ,
279even if listed in
280.Pa /etc/fstab .
281.Pp
282It would be nice if
283.Nm dump
284knew about the dump sequence,
285kept track of the tapes scribbled on,
286told the operator which tape to mount when,
287and provided more assistance
288for the operator running
289.Xr restore .
290.Sh HISTORY
291A
292.Nm
293command appeared in Version 6 AT&T UNIX.