Imported Upstream version 2.5.2p1
[debian/amanda] / man / amrestore.8
1 .\"     Title: amrestore
2 .\"    Author: 
3 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
4 .\"      Date: 06/06/2007
5 .\"    Manual: 
6 .\"    Source: 
7 .\"
8 .TH "AMRESTORE" "8" "06/06/2007" "" ""
9 .\" disable hyphenation
10 .nh
11 .\" disable justification (adjust text to left margin only)
12 .ad l
13 .SH "NAME"
14 amrestore \- extract backup images from an Amanda tape
15 .SH "SYNOPSIS"
16 .HP 10
17 \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 | ...]]]]]]
18 .SH "DESCRIPTION"
19 .PP
20 \fBAmrestore\fR
21 extracts backup images from the tape mounted on
22 \fItapedevice\fR
23 or from the holding disk file
24 \fIholdingfile\fR
25 that match
26 \fIhostname\fR,
27 \fIdiskname\fR
28 and
29 \fIdatestamp\fR
30 patterns given on the command line. The tape or holding file must be in a format written by the
31 \fBamdump\fR
32 or
33 \fBamflush\fR
34 program.
35 .PP
36 If
37 \fIdiskname\fR
38 is not specified, all backups on the tape for the previous
39 \fIhostname\fR
40 are candidates. If
41 \fIdatestamp\fR
42 is not specified, all backups on the tape for the previous
43 \fIhostname\fR
44 and
45 \fIdiskname\fR
46 are candidates. If no
47 \fIhostname\fR,
48 \fIdiskname\fR
49 or
50 \fIdatestamp\fR
51 are specified, every backup on the tape is a candidate.
52 .PP
53 \fIHostname\fR
54 and
55 \fIdiskname\fR
56 are special expressions described in the "HOST & DISK EXPRESSION" section of
57 \fBamanda\fR(8).
58 \fIDatestamp\fR
59 are special expression described in the "DATESTAMP EXPRESSION" section of
60 \fBamanda\fR(8). For example, if
61 \fIdiskname\fR
62 is "rz[23]a", it would match disks
63 \fBrz2a\fR
64 and
65 \fBrz3a\fR.
66 .PP
67 \fIDatestamp\fR
68 is useful if
69 \fBamflush\fR
70 writes multiple backup runs to a single tape.
71 .PP
72 Unless
73 \fB\-p\fR
74 is used, candidate backup images are extracted to files in the current directory named:
75 .PP
76 \fIhostname.diskname.datestamp.dumplevel\fR
77 .PP
78 Amrestore doesn't use a changer, it restore from the tape already loaded in the
79 \fItapedevice.\fR
80 .SH "OPTIONS"
81 .PP
82 \fB\-b\fR
83 .RS 4
84 Set the blocksize used to read the tape or holding file. All holding files must be read with a blocksize of 32 KBytes.
85 \fBAmrestore\fR
86 should normally be able to determine the blocksize for tapes on its own and not need this parameter.
87 .RE
88 .PP
89 The default is 32 KBytes.
90 .PP
91 \fB\-f\fR
92 .RS 4
93 Do a rewind followed by a fsf <fileno> before trying to restore an image.
94 .RE
95 .PP
96 \fB\-l\fR
97 .RS 4
98 Check if we restoring from the tape with the right
99 \fIlabel\fR
100 .RE
101 .PP
102 \fB\-p\fR
103 .RS 4
104 Pipe output. The first matching backup image is sent to standard output, which is normally a pipe to
105 \fBrestore\fR
106 or
107 \fBtar\fR, then
108 \fBamrestore\fR
109 quits. It may be run again to continue selecting backups to process. Make sure you specify the no\-rewind
110 \fItapedevice\fR
111 when doing this.
112 .RE
113 .PP
114 Note:
115 \fBrestore\fR
116 may report "short read" errors when reading from a pipe. Most versions of
117 \fBrestore\fR
118 support a blocking factor option to let you set the read block size, and you should set it to 2. See the example below.
119 .PP
120 \fB\-c\fR
121 .RS 4
122 Compress output using the fastest method the compression program provides.
123 \fBAmrestore\fR
124 normally writes output files in a format understood by
125 \fBrestore\fR
126 or
127 \fBtar\fR, even if the backups on the tape are compressed. With the
128 \fB\-c\fR
129 or
130 \fB\-C\fR
131 option,
132 \fBamrestore\fR
133 writes all files in compressed format, even if the backups on the tape are not compressed. Output file names will have a
134 \fB.Z\fR
135 or
136 \fB.gz\fR
137 extension depending on whether
138 \fBcompress\fR
139 or
140 \fBgzip\fR
141 is the preferred compression program. This option is useful when the current directory disk is small.
142 .RE
143 .PP
144 \fB\-C\fR
145 .RS 4
146 Compress output using the best method the compression program provides (may be very CPU intensive). See the notes above about the
147 \fB\-c\fR
148 option.
149 .RE
150 .PP
151 \fB\-r\fR
152 .RS 4
153 Raw output. Backup images are output exactly as they are on the tape, including the
154 \fBamdump\fR
155 headers. Output file names will have a
156 \fB.RAW\fR
157 extension. This option is only useful for debugging and other strange circumstances.
158 .RE
159 .PP
160 \fB\-h\fR
161 .RS 4
162 Header output. The tape header block is output at the beginning of each file. This is like
163 \fB\-r\fR
164 except
165 \fB\-c\fR
166 or
167 \fB\-C\fR
168 may also be used to compress the result.
169 \fBAmrecover\fR
170 uses the header to determine the restore program to use.
171 .RE
172 .PP
173 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.
174 .PP
175 \fB\-o\fR \fIconfigoption\fR
176 .RS 4
177 See the "\fBCONFIGURATION OVERRIDE\fR" section in
178 \fBamanda\fR(8).
179 .RE
180 .SH "EXAMPLES"
181 .PP
182 The following does an interactive restore of disk
183 \fIrz3g\fR
184 from host
185 \fIseine\fR, to restore particular files. Note the use of the
186 \fBb\fR
187 option to
188 \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.
189 .sp
190 .RS 4
191 .nf
192 % amrestore \-p /dev/nrmt9 seine rz3g | restore \-ivbf 2 \-
193 .fi
194 .RE
195 .sp
196 .PP
197 The next example extracts all backup images for host
198 \fIseine\fR. This is the usual way to extract all data for a host after a disk crash.
199 .sp
200 .RS 4
201 .nf
202 % amrestore /dev/nrmt9 seine
203 .fi
204 .RE
205 .sp
206 .PP
207 If the backup datestamp in the above example is
208 19910125
209 and
210 \fIseine\fR
211 has level 0 backups of disks
212 \fIrz1a\fR
213 and
214 \fIrz1g\fR
215 on the tape, these files will be created in the current directory:
216 .sp
217 .RS 4
218 .nf
219 seine.rz1a.19910125.0
220 seine.rz1g.19910125.0
221 .fi
222 .RE
223 .sp
224 .PP
225 You may also use
226 \fBamrestore\fR
227 to extract a backup image from a holding disk file that has not yet been flushed to tape:
228 .sp
229 .RS 4
230 .nf
231 % amrestore \-p /amanda/20001119/seine.rz1a.2 | restore \-ivbf 2 \-
232 .fi
233 .RE
234 .sp
235 .PP
236 \fBAmrestore\fR
237 may be used to generate a listing of images on a tape:
238 .sp
239 .RS 4
240 .nf
241 % mt \-f /dev/nrmt9 rewind
242 % amrestore \-p /dev/nrmt9 no\-such\-host > /dev/null
243 .fi
244 .RE
245 .sp
246 .PP
247 This asks
248 \fBamrestore\fR
249 to find images for host
250 \fBno\-such\-host\fR. It will not find any entries that match, but along the way will report each image it skips.
251 .SH "CAVEATS"
252 .PP
253 \fBGNU\-tar\fR
254 must be used to restore files from backup images created with the GNUTAR dumptype. Vendor tar programs sometimes fail to read GNU tar images.
255 .SH "AUTHOR"
256 .PP
257 James da Silva,
258 <jds@amanda.org>, University of Maryland, College Park: Original text
259 .PP
260 Stefan G. Weichinger,
261 <sgw@amanda.org>, maintainer of the
262 \fIAmanda\fR\-documentation: XML\-conversion
263 .SH "SEE ALSO"
264 .PP
265 \fBamanda\fR(8),
266 \fBamdump\fR(8),
267 \fBamflush\fR(8),
268 \fBtar\fR(1)
269 \fBrestore\fR(8)