]>
Commit | Line | Data |
---|---|---|
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 acknowledgment: | |
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 | .\" $Id: dump.8,v 1.2 1999/10/11 12:53:21 stelian Exp $ | |
35 | .\" | |
36 | .Dd May 1, 1995 | |
37 | .Dt DUMP 8 | |
38 | .Os BSD 4 | |
39 | .Sh NAME | |
40 | .Nm dump | |
41 | .Nd filesystem backup | |
42 | .Sh SYNOPSIS | |
43 | .Nm dump | |
44 | .Op Fl 0123456789acknu | |
45 | .Op Fl B Ar records | |
46 | .Op Fl b Ar blocksize | |
47 | .Op Fl d Ar density | |
48 | .Op Fl f Ar file | |
49 | .Op Fl h Ar level | |
50 | .Op Fl L Ar label | |
51 | .Op Fl s Ar feet | |
52 | .Op Fl T Ar date | |
53 | .Ar filesystem | |
54 | .Nm dump | |
55 | .Op Fl 0123456789acknu | |
56 | .Op Fl B Ar records | |
57 | .Op Fl b Ar blocksize | |
58 | .Op Fl d Ar density | |
59 | .Op Fl f Ar file | |
60 | .Op Fl h Ar level | |
61 | .Op Fl L Ar label | |
62 | .Op Fl s Ar feet | |
63 | .Op Fl T Ar date | |
64 | .Ar directory | |
65 | .Nm dump | |
66 | .Op Fl W Li \&| Fl w | |
67 | .Pp | |
68 | .in -\\n(iSu | |
69 | (The | |
70 | .Bx 4.3 | |
71 | option syntax is implemented for backward compatibility, but | |
72 | is not documented here.) | |
73 | .Sh DESCRIPTION | |
74 | .Nm Dump | |
75 | examines files | |
76 | on a filesystem | |
77 | and determines which files | |
78 | need to be backed up. These files | |
79 | are copied to the given disk, tape or other | |
80 | storage medium for safe keeping (see the | |
81 | .Fl f | |
82 | option below for doing remote backups). | |
83 | A dump that is larger than the output medium is broken into | |
84 | multiple volumes. | |
85 | On most media the size is determined by writing until an | |
86 | end-of-media indication is returned. This can be enforced | |
87 | by using the | |
88 | .Fl a | |
89 | option. | |
90 | .Pp | |
91 | On media that cannot reliably return an end-of-media indication | |
92 | (such as some cartridge tape drives) | |
93 | each volume is of a fixed size; | |
94 | the actual size is determined by the tape size and density and/or | |
95 | block count options below. | |
96 | By default, the same output file name is used for each volume | |
97 | after prompting the operator to change media. | |
98 | .Pp | |
99 | The following options are supported by | |
100 | .Nm Ns : | |
101 | .Bl -tag -width Ds | |
102 | .It Fl 0\-9 | |
103 | Dump levels. | |
104 | A level 0, full backup, | |
105 | guarantees the entire file system is copied | |
106 | (but see also the | |
107 | .Fl h | |
108 | option below). | |
109 | A level number above 0, | |
110 | incremental backup, | |
111 | tells dump to | |
112 | copy all files new or modified since the | |
113 | last dump of any lower level. | |
114 | The default level is 0. | |
115 | .It Fl B Ar records | |
116 | The number of 1 KB blocks per volume. | |
117 | This option overrides the calculation of tape size | |
118 | based on length and density. | |
119 | .It Fl a | |
120 | .Dq auto-size . | |
121 | Bypass all tape length considerations, and enforce writing | |
122 | until an end-of-media indication is returned. This fits best | |
123 | for most modern tape drives. Use of this option is particularly | |
124 | recommended when appending to an existing tape, or using a tape | |
125 | drive with hardware compression (where you can never be sure about | |
126 | the compression ratio). | |
127 | .It Fl b Ar blocksize | |
128 | The number of kilobytes per dump record. | |
129 | .It Fl c | |
130 | Change the defaults for use with a cartridge tape drive, with a density | |
131 | of 8000 bpi, and a length of 1700 feet. | |
132 | .It Fl h Ar level | |
133 | Honor the user | |
134 | .Dq nodump | |
135 | flag | |
136 | .Dp Dv UF_NODUMP | |
137 | only for dumps at or above the given | |
138 | .Ar level . | |
139 | The default honor level is 1, | |
140 | so that incremental backups omit such files | |
141 | but full backups retain them. | |
142 | .It Fl d Ar density | |
143 | Set tape density to | |
144 | .Ar density . | |
145 | The default is 1600BPI. | |
146 | .It Fl f Ar file | |
147 | Write the backup to | |
148 | .Ar file ; | |
149 | .Ar file | |
150 | may be a special device file | |
151 | like | |
152 | .Pa /dev/rmt12 | |
153 | (a tape drive), | |
154 | .Pa /dev/rsd1c | |
155 | (a floppy disk drive), | |
156 | an ordinary file, | |
157 | or | |
158 | .Ql Fl | |
159 | (the standard output). | |
160 | Multiple file names may be given as a single argument separated by commas. | |
161 | Each file will be used for one dump volume in the order listed; | |
162 | if the dump requires more volumes than the number of names given, | |
163 | the last file name will used for all remaining volumes after prompting | |
164 | for media changes. | |
165 | If the name of the file is of the form | |
166 | .Dq host:file , | |
167 | or | |
168 | .Dq user@host:file , | |
169 | .Nm | |
170 | writes to the named file on the remote host using | |
171 | .Xr rmt 8 . | |
172 | The default path name of the remote | |
173 | .Xr rmt 8 | |
174 | program is | |
175 | .\" rmt path, is the path on the remote host | |
176 | .Pa /etc/rmt ; | |
177 | this can be overridden by the environment variable | |
178 | .Ev RMT . | |
179 | .It Fl k | |
180 | Use Kerberos authentication to talk to remote tape servers. (Only | |
181 | available if this option was enabled when | |
182 | .Nm | |
183 | was compiled.) | |
184 | .It Fl L Ar label | |
185 | The user-supplied text string | |
186 | .Ar label | |
187 | is placed into the dump header, where tools like | |
188 | .Xr restore 8 | |
189 | and | |
190 | .Xr file 1 | |
191 | can access it. | |
192 | Note that this label is limited | |
193 | to be at most LBLSIZE (currently 16) characters, which must include | |
194 | the terminating | |
195 | .Ql \e0 . | |
196 | .It Fl n | |
197 | Whenever | |
198 | .Nm | |
199 | requires operator attention, | |
200 | notify all operators in the group | |
201 | .Dq operator | |
202 | by means similar to a | |
203 | .Xr wall 1 . | |
204 | .It Fl s Ar feet | |
205 | Attempt to calculate the amount of tape needed | |
206 | at a particular density. | |
207 | If this amount is exceeded, | |
208 | .Nm | |
209 | prompts for a new tape. | |
210 | It is recommended to be a bit conservative on this option. | |
211 | The default tape length is 2300 feet. | |
212 | .ne 1i | |
213 | .It Fl T Ar date | |
214 | Use the specified date as the starting time for the dump | |
215 | instead of the time determined from looking in | |
216 | .Pa /etc/dumpdates . | |
217 | The format of date is the same as that of | |
218 | .Xr ctime 3 . | |
219 | This option is useful for automated dump scripts that wish to | |
220 | dump over a specific period of time. | |
221 | The | |
222 | .Fl T | |
223 | option is mutually exclusive from the | |
224 | .Fl u | |
225 | option. | |
226 | .It Fl u | |
227 | Update the file | |
228 | .Pa /etc/dumpdates | |
229 | after a successful dump. | |
230 | The format of | |
231 | .Pa /etc/dumpdates | |
232 | is readable by people, consisting of one | |
233 | free format record per line: | |
234 | filesystem name, | |
235 | increment level | |
236 | and | |
237 | .Xr ctime 3 | |
238 | format dump date. | |
239 | There may be only one entry per filesystem at each level. | |
240 | The file | |
241 | .Pa /etc/dumpdates | |
242 | may be edited to change any of the fields, | |
243 | if necessary. | |
244 | .It Fl W | |
245 | .Nm Dump | |
246 | tells the operator what file systems need to be dumped. | |
247 | This information is gleaned from the files | |
248 | .Pa /etc/dumpdates | |
249 | and | |
250 | .Pa /etc/fstab . | |
251 | The | |
252 | .Fl W | |
253 | option causes | |
254 | .Nm | |
255 | to print out, for each file system in | |
256 | .Pa /etc/dumpdates | |
257 | the most recent dump date and level, | |
258 | and highlights those file systems that should be dumped. | |
259 | If the | |
260 | .Fl W | |
261 | option is set, all other options are ignored, and | |
262 | .Nm | |
263 | exits immediately. | |
264 | .It Fl w | |
265 | Is like W, but prints only those filesystems which need to be dumped. | |
266 | .El | |
267 | .Pp | |
268 | .Nm Dump | |
269 | requires operator intervention on these conditions: | |
270 | end of tape, | |
271 | end of dump, | |
272 | tape write error, | |
273 | tape open error or | |
274 | disk read error (if there are more than a threshold of 32). | |
275 | In addition to alerting all operators implied by the | |
276 | .Fl n | |
277 | key, | |
278 | .Nm | |
279 | interacts with the operator on | |
280 | .Em dump's | |
281 | control terminal at times when | |
282 | .Nm | |
283 | can no longer proceed, | |
284 | or if something is grossly wrong. | |
285 | All questions | |
286 | .Nm | |
287 | poses | |
288 | .Em must | |
289 | be answered by typing | |
290 | .Dq yes | |
291 | or | |
292 | .Dq no , | |
293 | appropriately. | |
294 | .Pp | |
295 | Since making a dump involves a lot of time and effort for full dumps, | |
296 | .Nm | |
297 | checkpoints itself at the start of each tape volume. | |
298 | If writing that volume fails for some reason, | |
299 | .Nm | |
300 | will, | |
301 | with operator permission, | |
302 | restart itself from the checkpoint | |
303 | after the old tape has been rewound and removed, | |
304 | and a new tape has been mounted. | |
305 | .Pp | |
306 | .Nm Dump | |
307 | tells the operator what is going on at periodic intervals, | |
308 | including usually low estimates of the number of blocks to write, | |
309 | the number of tapes it will take, the time to completion, and | |
310 | the time to the tape change. | |
311 | The output is verbose, | |
312 | so that others know that the terminal | |
313 | controlling | |
314 | .Nm | |
315 | is busy, | |
316 | and will be for some time. | |
317 | .Pp | |
318 | In the event of a catastrophic disk event, the time required | |
319 | to restore all the necessary backup tapes or files to disk | |
320 | can be kept to a minimum by staggering the incremental dumps. | |
321 | An efficient method of staggering incremental dumps | |
322 | to minimize the number of tapes follows: | |
323 | .Bl -bullet -offset indent | |
324 | .It | |
325 | Always start with a level 0 backup, for example: | |
326 | .Bd -literal -offset indent | |
327 | /sbin/dump -0u -f /dev/nrst1 /usr/src | |
328 | .Ed | |
329 | .Pp | |
330 | This should be done at set intervals, say once a month or once every two months, | |
331 | and on a set of fresh tapes that is saved forever. | |
332 | .It | |
333 | After a level 0, dumps of active file | |
334 | systems are taken on a daily basis, | |
335 | using a modified Tower of Hanoi algorithm, | |
336 | with this sequence of dump levels: | |
337 | .Bd -literal -offset indent | |
338 | 3 2 5 4 7 6 9 8 9 9 ... | |
339 | .Ed | |
340 | .Pp | |
341 | For the daily dumps, it should be possible to use a fixed number of tapes | |
342 | for each day, used on a weekly basis. | |
343 | Each week, a level 1 dump is taken, and | |
344 | the daily Hanoi sequence repeats beginning with 3. | |
345 | For weekly dumps, another fixed set of tapes per dumped file system is | |
346 | used, also on a cyclical basis. | |
347 | .El | |
348 | .Pp | |
349 | After several months or so, the daily and weekly tapes should get | |
350 | rotated out of the dump cycle and fresh tapes brought in. | |
351 | .Sh ENVIRONMENT | |
352 | .Bl -tag -width Fl | |
353 | .It Ev TAPE | |
354 | If no -f option was specified, | |
355 | .Nm | |
356 | will use the device specified via | |
357 | .Ev TAPE | |
358 | as the dump device. | |
359 | .Ev TAPE | |
360 | may be of the form | |
361 | .Qq tapename , | |
362 | .Qq host:tapename , | |
363 | or | |
364 | .Qq user@host:tapename . | |
365 | .It Ev RMT | |
366 | The environment variable | |
367 | .Ev RMT | |
368 | will be used to determine the pathname of the remote | |
369 | .Xr rmt 8 | |
370 | program. | |
371 | .Sh FILES | |
372 | .Bl -tag -width /etc/dumpdates -compact | |
373 | .It Pa /dev/rmt8 | |
374 | default tape unit to dump to | |
375 | .It Pa /etc/dumpdates | |
376 | dump date records | |
377 | .It Pa /etc/fstab | |
378 | dump table: file systems and frequency | |
379 | .It Pa /etc/group | |
380 | to find group | |
381 | .Em operator | |
382 | .El | |
383 | .Sh SEE ALSO | |
384 | .Xr fstab 5 , | |
385 | .Xr restore 8 , | |
386 | .Xr rmt 8 | |
387 | .Sh DIAGNOSTICS | |
388 | Many, and verbose. | |
389 | .Pp | |
390 | Dump exits with zero status on success. | |
391 | Startup errors are indicated with an exit code of 1; | |
392 | abnormal termination is indicated with an exit code of 3. | |
393 | .Sh BUGS | |
394 | Fewer than 32 read errors on the filesystem are ignored. | |
395 | .Pp | |
396 | Each reel requires a new process, so parent processes for | |
397 | reels already written just hang around until the entire tape | |
398 | is written. | |
399 | .Pp | |
400 | .Nm Dump | |
401 | with the | |
402 | .Fl W | |
403 | or | |
404 | .Fl w | |
405 | options does not report filesystems that have never been recorded | |
406 | in | |
407 | .Pa /etc/dumpdates , | |
408 | even if listed in | |
409 | .Pa /etc/fstab . | |
410 | .Pp | |
411 | It would be nice if | |
412 | .Nm | |
413 | knew about the dump sequence, | |
414 | kept track of the tapes scribbled on, | |
415 | told the operator which tape to mount when, | |
416 | and provided more assistance | |
417 | for the operator running | |
418 | .Xr restore . | |
419 | .Pp | |
420 | .Nm Dump | |
421 | cannot do remote backups without being run as root, due to its | |
422 | security history. This will be fixed in a later version of | |
423 | .Bx Free . | |
424 | Presently, it works if you set it setuid (like it used to be), but this | |
425 | might constitute a security risk. | |
426 | .Sh HISTORY | |
427 | A | |
428 | .Nm | |
429 | command appeared in | |
430 | .At v6 . |