64615a0563ed691c61b9e0be217a4eb1becedc60
[debian/amanda] / man / amrestore.8
1 .\"     Title: amrestore
2 .\"    Author: James da Silva <jds@amanda.org>
3 .\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
4 .\"      Date: 01/22/2009
5 .\"    Manual: System Administration Commands
6 .\"    Source: Amanda 2.6.1
7 .\"  Language: English
8 .\"
9 .TH "AMRESTORE" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands"
10 .\" -----------------------------------------------------------------
11 .\" * (re)Define some macros
12 .\" -----------------------------------------------------------------
13 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 .\" toupper - uppercase a string (locale-aware)
15 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 .de toupper
17 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
18 \\$*
19 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
20 ..
21 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 .\" SH-xref - format a cross-reference to an SH section
23 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 .de SH-xref
25 .ie n \{\
26 .\}
27 .toupper \\$*
28 .el \{\
29 \\$*
30 .\}
31 ..
32 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 .\" SH - level-one heading that works better for non-TTY output
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 .de1 SH
36 .\" put an extra blank line of space above the head in non-TTY output
37 .if t \{\
38 .sp 1
39 .\}
40 .sp \\n[PD]u
41 .nr an-level 1
42 .set-an-margin
43 .nr an-prevailing-indent \\n[IN]
44 .fi
45 .in \\n[an-margin]u
46 .ti 0
47 .HTML-TAG ".NH \\n[an-level]"
48 .it 1 an-trap
49 .nr an-no-space-flag 1
50 .nr an-break-flag 1
51 \." make the size of the head bigger
52 .ps +3
53 .ft B
54 .ne (2v + 1u)
55 .ie n \{\
56 .\" if n (TTY output), use uppercase
57 .toupper \\$*
58 .\}
59 .el \{\
60 .nr an-break-flag 0
61 .\" if not n (not TTY), use normal case (not uppercase)
62 \\$1
63 .in \\n[an-margin]u
64 .ti 0
65 .\" if not n (not TTY), put a border/line under subheading
66 .sp -.6
67 \l'\n(.lu'
68 .\}
69 ..
70 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 .\" SS - level-two heading that works better for non-TTY output
72 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 .de1 SS
74 .sp \\n[PD]u
75 .nr an-level 1
76 .set-an-margin
77 .nr an-prevailing-indent \\n[IN]
78 .fi
79 .in \\n[IN]u
80 .ti \\n[SN]u
81 .it 1 an-trap
82 .nr an-no-space-flag 1
83 .nr an-break-flag 1
84 .ps \\n[PS-SS]u
85 \." make the size of the head bigger
86 .ps +2
87 .ft B
88 .ne (2v + 1u)
89 .if \\n[.$] \&\\$*
90 ..
91 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92 .\" BB/BE - put background/screen (filled box) around block of text
93 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94 .de BB
95 .if t \{\
96 .sp -.5
97 .br
98 .in +2n
99 .ll -2n
100 .gcolor red
101 .di BX
102 .\}
103 ..
104 .de EB
105 .if t \{\
106 .if "\\$2"adjust-for-leading-newline" \{\
107 .sp -1
108 .\}
109 .br
110 .di
111 .in
112 .ll
113 .gcolor
114 .nr BW \\n(.lu-\\n(.i
115 .nr BH \\n(dn+.5v
116 .ne \\n(BHu+.5v
117 .ie "\\$2"adjust-for-leading-newline" \{\
118 \M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
119 .\}
120 .el \{\
121 \M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
122 .\}
123 .in 0
124 .sp -.5v
125 .nf
126 .BX
127 .in
128 .sp .5v
129 .fi
130 .\}
131 ..
132 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133 .\" BM/EM - put colored marker in margin next to block of text
134 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135 .de BM
136 .if t \{\
137 .br
138 .ll -2n
139 .gcolor red
140 .di BX
141 .\}
142 ..
143 .de EM
144 .if t \{\
145 .br
146 .di
147 .ll
148 .gcolor
149 .nr BH \\n(dn
150 .ne \\n(BHu
151 \M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
152 .in 0
153 .nf
154 .BX
155 .in
156 .fi
157 .\}
158 ..
159 .\" -----------------------------------------------------------------
160 .\" * set default formatting
161 .\" -----------------------------------------------------------------
162 .\" disable hyphenation
163 .nh
164 .\" disable justification (adjust text to left margin only)
165 .ad l
166 .\" -----------------------------------------------------------------
167 .\" * MAIN CONTENT STARTS HERE *
168 .\" -----------------------------------------------------------------
169 .SH "Name"
170 amrestore \- extract backup images from an \fIAmanda\fR tape
171 .SH "Synopsis"
172 .fam C
173 .HP \w'\fBamrestore\fR\ 'u
174 \fBamrestore\fR [\-r | \-c | \-C] [\-b | \fIblocksize\fR] [\-f | \fIfileno\fR] [\-l | \fIlabel\fR] [\-p] [\-h] \fItapedevice\fR|\ \fIholdingfile\fR  [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR | \&.\&.\&.]]]]]]
175 .fam
176 .SH "DESCRIPTION"
177 .PP
178 \fBAmrestore\fR
179 extracts backup images from the tape mounted on
180 \fItapedevice\fR
181 or from the holding disk file
182 \fIholdingfile\fR
183 that match
184 \fIhostname\fR,
185 \fIdiskname\fR
186 and
187 \fIdatestamp\fR
188 patterns given on the command line\&. The tape or holding file must be in a format written by the
189 \fBamdump\fR
190 or
191 \fBamflush\fR
192 program\&.
193 .PP
194 If
195 \fIdiskname\fR
196 is not specified, all backups on the tape for the previous
197 \fIhostname\fR
198 are candidates\&. If
199 \fIdatestamp\fR
200 is not specified, all backups on the tape for the previous
201 \fIhostname\fR
202 and
203 \fIdiskname\fR
204 are candidates\&. If no
205 \fIhostname\fR,
206 \fIdiskname\fR
207 or
208 \fIdatestamp\fR
209 are specified, every backup on the tape is a candidate\&.
210 .PP
211 \fIHostname\fR
212 and
213 \fIdiskname\fR
214 are special expressions described in the "HOST & DISK EXPRESSION" section of
215 \fBamanda\fR(8)\&.
216 \fIDatestamp\fR
217 are special expression described in the "DATESTAMP EXPRESSION" section of
218 \fBamanda\fR(8)\&. For example, if
219 \fIdiskname\fR
220 is "rz[23]a", it would match disks
221 \fBrz2a\fR
222 and
223 \fBrz3a\fR\&.
224 .PP
225 \fIDatestamp\fR
226 is useful if
227 \fBamflush\fR
228 writes multiple backup runs to a single tape\&.
229 .PP
230 Unless
231 \fB\-p\fR
232 is used, candidate backup images are extracted to files in the current directory named:
233 .PP
234 \fIhostname\&.diskname\&.datestamp\&.dumplevel\fR
235 .PP
236 Amrestore doesn\'t use a changer, it restore from the tape already loaded in the
237 \fItapedevice\&.\fR
238 .SH "OPTIONS"
239 .PP
240 \fB\-b\fR
241 .RS 4
242 Set the blocksize used to read the tape or holding file\&. All holding files must be read with a blocksize of 32 KBytes\&.
243 \fBAmrestore\fR
244 should normally be able to determine the blocksize for tapes on its own and not need this parameter\&.
245 .RE
246 .PP
247 The default is 32 KBytes\&.
248 .PP
249 \fB\-f\fR
250 .RS 4
251 Do a rewind followed by a fsf <fileno> before trying to restore an image\&.
252 .RE
253 .PP
254 \fB\-l\fR
255 .RS 4
256 Check if we restoring from the tape with the right
257 \fIlabel\fR
258 .RE
259 .PP
260 \fB\-p\fR
261 .RS 4
262 Pipe output\&. The first matching backup image is sent to standard output, which is normally a pipe to
263 \fBrestore\fR
264 or
265 \fBtar\fR, then
266 \fBamrestore\fR
267 quits\&. It may be run again to continue selecting backups to process\&. Make sure you specify the no\-rewind
268 \fItapedevice\fR
269 when doing this\&.
270 .RE
271 .PP
272 Note:
273 \fBrestore\fR
274 may report "short read" errors when reading from a pipe\&. Most versions of
275 \fBrestore\fR
276 support a blocking factor option to let you set the read block size, and you should set it to 2\&. See the example below\&.
277 .PP
278 \fB\-c\fR
279 .RS 4
280 Compress output using the fastest method the compression program provides\&.
281 \fBAmrestore\fR
282 normally writes output files in a format understood by
283 \fBrestore\fR
284 or
285 \fBtar\fR, even if the backups on the tape are compressed\&. With the
286 \fB\-c\fR
287 or
288 \fB\-C\fR
289 option,
290 \fBamrestore\fR
291 writes all files in compressed format, even if the backups on the tape are not compressed\&. Output file names will have a
292 \fB\&.Z\fR
293 or
294 \fB\&.gz\fR
295 extension depending on whether
296 \fBcompress\fR
297 or
298 \fBgzip\fR
299 is the preferred compression program\&. This option is useful when the current directory disk is small\&.
300 .RE
301 .PP
302 \fB\-C\fR
303 .RS 4
304 Compress output using the best method the compression program provides (may be very CPU intensive)\&. See the notes above about the
305 \fB\-c\fR
306 option\&.
307 .RE
308 .PP
309 \fB\-r\fR
310 .RS 4
311 Raw output\&. Backup images are output exactly as they are on the tape, including the
312 \fBamdump\fR
313 headers\&. Output file names will have a
314 \fB\&.RAW\fR
315 extension\&. This option is only useful for debugging and other strange circumstances\&.
316 .RE
317 .PP
318 \fB\-h\fR
319 .RS 4
320 Header output\&. The tape header block is output at the beginning of each file\&. This is like
321 \fB\-r\fR
322 except
323 \fB\-c\fR
324 or
325 \fB\-C\fR
326 may also be used to compress the result\&.
327 \fBAmrecover\fR
328 uses the header to determine the restore program to use\&.
329 .RE
330 .PP
331 If a header is written (\-r or \-h), only 32 KBytes are output regardless of the tape blocksize\&. This makes the resulting image usable as a holding file\&.
332 .PP
333 \fB\-o\fR \fIconfigoption\fR
334 .RS 4
335 See the "\fBCONFIGURATION OVERRIDE\fR" section in
336 \fBamanda\fR(8)\&.
337 .RE
338 .SH "EXAMPLES"
339 .PP
340 The following does an interactive restore of disk
341 \fIrz3g\fR
342 from host
343 \fIseine\fR, to restore particular files\&. Note the use of the
344 \fBb\fR
345 option to
346 \fBrestore\fR, which causes it to read in units of two 512\-byte blocks (1 Kbyte) at a time\&. This helps keep it from complaining about short reads\&.
347 .sp
348 .if n \{\
349 .RS 4
350 .\}
351 .fam C
352 .ps -1
353 .nf
354 .if t \{\
355 .sp -1
356 .\}
357 .BB lightgray adjust-for-leading-newline
358 .sp -1
359
360 % amrestore \-p /dev/nrmt9 seine rz3g | restore \-ivbf 2 \-
361 .EB lightgray adjust-for-leading-newline
362 .if t \{\
363 .sp 1
364 .\}
365 .fi
366 .fam
367 .ps +1
368 .if n \{\
369 .RE
370 .\}
371 .PP
372 The next example extracts all backup images for host
373 \fIseine\fR\&. This is the usual way to extract all data for a host after a disk crash\&.
374 .sp
375 .if n \{\
376 .RS 4
377 .\}
378 .fam C
379 .ps -1
380 .nf
381 .if t \{\
382 .sp -1
383 .\}
384 .BB lightgray adjust-for-leading-newline
385 .sp -1
386
387 % amrestore /dev/nrmt9 seine
388 .EB lightgray adjust-for-leading-newline
389 .if t \{\
390 .sp 1
391 .\}
392 .fi
393 .fam
394 .ps +1
395 .if n \{\
396 .RE
397 .\}
398 .PP
399 If the backup datestamp in the above example is
400 \FC19910125\F[]
401 and
402 \fIseine\fR
403 has level 0 backups of disks
404 \fIrz1a\fR
405 and
406 \fIrz1g\fR
407 on the tape, these files will be created in the current directory:
408 .sp
409 .if n \{\
410 .RS 4
411 .\}
412 .fam C
413 .ps -1
414 .nf
415 .if t \{\
416 .sp -1
417 .\}
418 .BB lightgray adjust-for-leading-newline
419 .sp -1
420
421 seine\&.rz1a\&.19910125\&.0
422 seine\&.rz1g\&.19910125\&.0
423 .EB lightgray adjust-for-leading-newline
424 .if t \{\
425 .sp 1
426 .\}
427 .fi
428 .fam
429 .ps +1
430 .if n \{\
431 .RE
432 .\}
433 .PP
434 You may also use
435 \fBamrestore\fR
436 to extract a backup image from a holding disk file that has not yet been flushed to tape:
437 .sp
438 .if n \{\
439 .RS 4
440 .\}
441 .fam C
442 .ps -1
443 .nf
444 .if t \{\
445 .sp -1
446 .\}
447 .BB lightgray adjust-for-leading-newline
448 .sp -1
449
450 % amrestore \-p /amanda/20001119/seine\&.rz1a\&.2 | restore \-ivbf 2 \-
451 .EB lightgray adjust-for-leading-newline
452 .if t \{\
453 .sp 1
454 .\}
455 .fi
456 .fam
457 .ps +1
458 .if n \{\
459 .RE
460 .\}
461 .PP
462 \fBAmrestore\fR
463 may be used to generate a listing of images on a tape:
464 .sp
465 .if n \{\
466 .RS 4
467 .\}
468 .fam C
469 .ps -1
470 .nf
471 .if t \{\
472 .sp -1
473 .\}
474 .BB lightgray adjust-for-leading-newline
475 .sp -1
476
477 % mt \-f /dev/nrmt9 rewind
478 % amrestore \-p /dev/nrmt9 no\-such\-host > /dev/null
479 .EB lightgray adjust-for-leading-newline
480 .if t \{\
481 .sp 1
482 .\}
483 .fi
484 .fam
485 .ps +1
486 .if n \{\
487 .RE
488 .\}
489 .PP
490 This asks
491 \fBamrestore\fR
492 to find images for host
493 \fBno\-such\-host\fR\&. It will not find any entries that match, but along the way will report each image it skips\&.
494 .SH "CAVEATS"
495 .PP
496 \fBGNU\-tar\fR
497 must be used to restore files from backup images created with the GNUTAR dumptype\&. Vendor tar programs sometimes fail to read GNU tar images\&.
498 .SH "SEE ALSO"
499 .PP
500 \fBamanda\fR(8),
501 \fBamdump\fR(8),
502 \fBamflush\fR(8),
503 \fBtar\fR(1),
504 \fBrestore\fR(8),
505 : http://wiki.zmanda.com
506 .SH "Authors"
507 .PP
508 \fBJames da Silva\fR <\&jds@amanda\&.org\&>
509 .PP
510 \fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&>