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