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