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