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