xref: /original-bsd/sbin/dump/dump.8 (revision 7bad34b3)
1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)dump.8	6.6 (Berkeley) 03/16/91
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.
81The format of
82.Pa /etc/dumpdates
83is readable by people, consisting of one
84free format record per line:
85filesystem name,
86increment level
87and
88.Xr ctime 3
89format dump date.
90There may be only one entry per filesystem at each level.
91The file
92.Pa /etc/dumpdates
93may be edited to change any of the fields,
94if necessary.
95.It Cm W
96.Nm Dump
97tells the operator what file systems need to be dumped.
98This information is gleaned from the files
99.Pa /etc/dumpdates
100and
101.Pa /etc/fstab .
102The
103.Cm W
104option causes
105.Nm dump
106to print out, for each file system in
107.Pa /etc/dumpdates
108the most recent dump date and level,
109and highlights those file systems that should be dumped.
110If the
111.Cm W
112option is set, all other options are ignored, and
113.Nm dump
114exits immediately.
115.It Cm w
116Is like W, but prints only those filesystems which need to be dumped.
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
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
133.Cm n
134key,
135.Nm dump
136interacts with the operator on
137.Em dump's
138control terminal at times when
139.Nm dump
140can no longer proceed,
141or if something is grossly wrong.
142All questions
143.Nm dump
144poses
145.Em must
146be answered by typing \*(lqyes\*(rq or \*(lqno\*(rq,
147appropriately.
148.Pp
149Since making a dump involves a lot of time and effort for full dumps,
150.Nm dump
151checkpoints itself at the start of each tape volume.
152If writing that volume fails for some reason,
153.Nm dump
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.
159.Pp
160.Nm Dump
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
168.Nm dump
169is busy,
170and will be for some time.
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
188systems are taken on a daily basis,
189using a modified Tower of Hanoi algorithm,
190with this sequence of dump levels:
191.Bd -literal -offset indent
1923 2 5 4 7 6 9 8 9 9 ...
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.
197Each week, a level 1 dump is taken, and
198the daily Hanoi sequence repeats beginning with 3.
199For weekly dumps, another fixed set of tapes per dumped file system is
200used, also on a cyclical basis.
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
225Many, and verbose.
226.Pp
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.
230.Sh BUGS
231.Pp
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.
236.Pp
237.Nm Dump
238with the
239.Cm W
240or
241.Cm w
242options does not report filesystems that have never been recorded
243in
244.Pa /etc/dumpdates ,
245even if listed in
246.Pa /etc/fstab .
247.Pp
248It would be nice if
249.Nm dump
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
255.Xr restore .
256.Sh HISTORY
257A
258.Nm
259command appeared in Version 6 AT&T UNIX.
260