]> git.wh0rd.org - dump.git/blob - dump/dump.8
Initial revision
[dump.git] / dump / dump.8
1 .\" Copyright (c) 1980, 1991, 1993
2 .\" Regents of the University of California.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by the University of
16 .\" California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\" @(#)dump.8 8.3 (Berkeley) 5/1/95
34 .\"
35 .Dd May 1, 1995
36 .Dt DUMP 8
37 .Os BSD 4
38 .Sh NAME
39 .Nm dump
40 .Nd filesystem backup
41 .Sh SYNOPSIS
42 .Nm dump
43 .Op Fl 0123456789cnu
44 .Op Fl B Ar records
45 .Op Fl b Ar blocksize
46 .Op Fl d Ar density
47 .Op Fl f Ar file
48 .Op Fl h Ar level
49 .Op Fl s Ar feet
50 .Op Fl T Ar date
51 .Ar filesystem
52 .Nm dump
53 .Op Fl 0123456789cnu
54 .Op Fl B Ar records
55 .Op Fl b Ar blocksize
56 .Op Fl d Ar density
57 .Op Fl f Ar file
58 .Op Fl h Ar level
59 .Op Fl s Ar feet
60 .Op Fl T Ar date
61 .Ar directory
62 .Nm dump
63 .Op Fl W Li \&| Fl w
64 .Pp
65 .in -\\n(iSu
66 (The
67 .Bx 4.3
68 option syntax is implemented for backward compatibility, but
69 is not documented here.)
70 .Sh DESCRIPTION
71 .Nm Dump
72 examines files
73 on a filesystem
74 and determines which files
75 need to be backed up. These files
76 are copied to the given disk, tape or other
77 storage medium for safe keeping (see the
78 .Fl f
79 option below for doing remote backups).
80 A dump that is larger than the output medium is broken into
81 multiple volumes.
82 On most media the size is determined by writing until an
83 end-of-media indication is returned.
84 On media that cannot reliably return an end-of-media indication
85 (such as some cartridge tape drives)
86 each volume is of a fixed size;
87 the actual size is determined by the tape size and density and/or
88 block count options below.
89 By default, the same output file name is used for each volume
90 after prompting the operator to change media.
91 .Pp
92 The following options are supported by
93 .Nm dump :
94 .Bl -tag -width Ds
95 .It Fl 0\-9
96 Dump levels.
97 A level 0, full backup,
98 guarantees the entire file system is copied
99 (but see also the
100 .Fl h
101 option below).
102 A level number above 0,
103 incremental backup,
104 tells dump to
105 copy all files new or modified since the
106 last dump of the same or lower level.
107 The default level is 9.
108 .It Fl B Ar records
109 The number of dump records per volume.
110 This option overrides the calculation of tape size
111 based on length and density.
112 .It Fl b Ar blocksize
113 The number of kilobytes per dump record.
114 .It Fl c
115 Modify the calculation of the default density and tape size to be more
116 appropriate for cartridge tapes.
117 .It Fl d Ar density
118 Set tape density to
119 .Ar density .
120 The default is 1600BPI.
121 .It Fl f Ar file
122 Write the backup to
123 .Ar file ;
124 .Ar file
125 may be a special device file
126 like
127 .Pa /dev/rmt12
128 (a tape drive),
129 .Pa /dev/rsd1c
130 (a disk drive),
131 an ordinary file,
132 or
133 .Ql Fl
134 (the standard output).
135 Multiple file names may be given as a single argument separated by commas.
136 Each file will be used for one dump volume in the order listed;
137 if the dump requires more volumes than the number of names given,
138 the last file name will used for all remaining volumes after prompting
139 for media changes.
140 If the name of the file is of the form
141 .Dq host:file ,
142 or
143 .Dq user@host:file ,
144 .Nm dump
145 writes to the named file on the remote host using
146 .Xr rmt 8 .
147 .It Fl h Ar level
148 Honor the user
149 .Dq nodump
150 flag
151 .Dp Dv UF_NODUMP
152 only for dumps at or above the given
153 .Ar level .
154 The default honor level is 1,
155 so that incremental backups omit such files
156 but full backups retain them.
157 .It Fl n
158 Whenever
159 .Nm dump
160 requires operator attention,
161 notify all operators in the group
162 .Dq operator
163 by means similar to a
164 .Xr wall 1 .
165 .It Fl s Ar feet
166 Attempt to calculate the amount of tape needed
167 at a particular density.
168 If this amount is exceeded,
169 .Nm dump
170 prompts for a new tape.
171 It is recommended to be a bit conservative on this option.
172 The default tape length is 2300 feet.
173 .ne 1i
174 .It Fl T Ar date
175 Use the specified date as the starting time for the dump
176 instead of the time determined from looking in
177 .Pa /etc/dumpdates .
178 The format of date is the same as that of
179 .Xr ctime 3 .
180 This option is useful for automated dump scripts that wish to
181 dump over a specific period of time.
182 The
183 .Fl T
184 option is mutually exclusive from the
185 .Fl u
186 option.
187 .It Fl u
188 Update the file
189 .Pa /etc/dumpdates
190 after a successful dump.
191 The format of
192 .Pa /etc/dumpdates
193 is readable by people, consisting of one
194 free format record per line:
195 filesystem name,
196 increment level
197 and
198 .Xr ctime 3
199 format dump date.
200 There may be only one entry per filesystem at each level.
201 The file
202 .Pa /etc/dumpdates
203 may be edited to change any of the fields,
204 if necessary.
205 .It Fl W
206 .Nm Dump
207 tells the operator what file systems need to be dumped.
208 This information is gleaned from the files
209 .Pa /etc/dumpdates
210 and
211 .Pa /etc/fstab .
212 The
213 .Fl W
214 option causes
215 .Nm dump
216 to print out, for each file system in
217 .Pa /etc/dumpdates
218 the most recent dump date and level,
219 and highlights those file systems that should be dumped.
220 If the
221 .Fl W
222 option is set, all other options are ignored, and
223 .Nm dump
224 exits immediately.
225 .It Fl w
226 Is like W, but prints only those filesystems which need to be dumped.
227 .El
228 .Pp
229 .Nm Dump
230 requires operator intervention on these conditions:
231 end of tape,
232 end of dump,
233 tape write error,
234 tape open error or
235 disk read error (if there are more than a threshold of 32).
236 In addition to alerting all operators implied by the
237 .Fl n
238 key,
239 .Nm dump
240 interacts with the operator on
241 .Em dump's
242 control terminal at times when
243 .Nm dump
244 can no longer proceed,
245 or if something is grossly wrong.
246 All questions
247 .Nm dump
248 poses
249 .Em must
250 be answered by typing
251 .Dq yes
252 or
253 .Dq no ,
254 appropriately.
255 .Pp
256 Since making a dump involves a lot of time and effort for full dumps,
257 .Nm dump
258 checkpoints itself at the start of each tape volume.
259 If writing that volume fails for some reason,
260 .Nm dump
261 will,
262 with operator permission,
263 restart itself from the checkpoint
264 after the old tape has been rewound and removed,
265 and a new tape has been mounted.
266 .Pp
267 .Nm Dump
268 tells the operator what is going on at periodic intervals,
269 including usually low estimates of the number of blocks to write,
270 the number of tapes it will take, the time to completion, and
271 the time to the tape change.
272 The output is verbose,
273 so that others know that the terminal
274 controlling
275 .Nm dump
276 is busy,
277 and will be for some time.
278 .Pp
279 In the event of a catastrophic disk event, the time required
280 to restore all the necessary backup tapes or files to disk
281 can be kept to a minimum by staggering the incremental dumps.
282 An efficient method of staggering incremental dumps
283 to minimize the number of tapes follows:
284 .Bl -bullet -offset indent
285 .It
286 Always start with a level 0 backup, for example:
287 .Bd -literal -offset indent
288 /sbin/dump -0u -f /dev/nrst1 /usr/src
289 .Ed
290 .Pp
291 This should be done at set intervals, say once a month or once every two months,
292 and on a set of fresh tapes that is saved forever.
293 .It
294 After a level 0, dumps of active file
295 systems are taken on a daily basis,
296 using a modified Tower of Hanoi algorithm,
297 with this sequence of dump levels:
298 .Bd -literal -offset indent
299 3 2 5 4 7 6 9 8 9 9 ...
300 .Ed
301 .Pp
302 For the daily dumps, it should be possible to use a fixed number of tapes
303 for each day, used on a weekly basis.
304 Each week, a level 1 dump is taken, and
305 the daily Hanoi sequence repeats beginning with 3.
306 For weekly dumps, another fixed set of tapes per dumped file system is
307 used, also on a cyclical basis.
308 .El
309 .Pp
310 After several months or so, the daily and weekly tapes should get
311 rotated out of the dump cycle and fresh tapes brought in.
312 .Sh FILES
313 .Bl -tag -width /etc/dumpdates -compact
314 .It Pa /dev/rmt8
315 default tape unit to dump to
316 .It Pa /etc/dumpdates
317 dump date records
318 .It Pa /etc/fstab
319 dump table: file systems and frequency
320 .It Pa /etc/group
321 to find group
322 .Em operator
323 .El
324 .Sh SEE ALSO
325 .Xr restore 8 ,
326 .Xr rmt 8 ,
327 .Xr dump 5 ,
328 .Xr fstab 5
329 .Sh DIAGNOSTICS
330 Many, and verbose.
331 .Pp
332 Dump exits with zero status on success.
333 Startup errors are indicated with an exit code of 1;
334 abnormal termination is indicated with an exit code of 3.
335 .Sh BUGS
336 Fewer than 32 read errors on the filesystem are ignored.
337 .Pp
338 Each reel requires a new process, so parent processes for
339 reels already written just hang around until the entire tape
340 is written.
341 .Pp
342 .Nm Dump
343 with the
344 .Fl W
345 or
346 .Fl w
347 options does not report filesystems that have never been recorded
348 in
349 .Pa /etc/dumpdates ,
350 even if listed in
351 .Pa /etc/fstab .
352 .Pp
353 It would be nice if
354 .Nm dump
355 knew about the dump sequence,
356 kept track of the tapes scribbled on,
357 told the operator which tape to mount when,
358 and provided more assistance
359 for the operator running
360 .Xr restore .
361 .Sh HISTORY
362 A
363 .Nm dump
364 command appeared in Version 6 AT&T UNIX.