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