Imported Upstream version 2.4.4p3
[debian/amanda] / man / amrestore.8
1 .\"
2 .de EX
3 .if t .ft C
4 .nf
5 ..
6 .de EE
7 .fi
8 .if t .ft
9 ..
10 .TH AMRESTORE 8
11 .SH NAME
12 amrestore \- extract backup images from an Amanda tape
13 .SH SYNOPSIS
14 .B amrestore
15 [
16 .B \-r
17 |
18 .B \-c
19 |
20 .B \-C
21 ]
22 [
23 .B \-b
24 .I blocksize
25 ]
26 [
27 .B \-f
28 .I fileno
29 ]
30 [
31 .B \-l
32 .I label
33 ]
34 [
35 .B \-p
36 ]
37 [
38 .B \-h
39 ]
40 .I tapedevice
41 |
42 .I holdingfile
43 [
44 .I hostname
45 [
46 .I diskname
47 [
48 .I datestamp
49 [
50 .I hostname
51 [
52 .I diskname
53 [
54 .I datestamp
55 \&...
56 ]]]]]]
57 .SH DESCRIPTION
58 .B Amrestore
59 extracts backup images from the tape mounted on
60 .I tapedevice
61 or from the holding disk file
62 .I holdingfile
63 that match
64 .IR hostname ,
65 .I diskname
66 and
67 .I datestamp
68 patterns given on the command line.
69 The tape or holding file must be in a format written by the
70 .B amdump
71 or
72 .B amflush
73 program.
74 .LP
75 If
76 .I diskname
77 is not specified, all backups on the tape for the previous
78 .I hostname
79 are candidates.
80 If
81 .I datestamp
82 is not specified, all backups on the tape for the previous
83 .I hostname
84 and
85 .I diskname
86 are candidates.
87 If no
88 .IR hostname ,
89 .I diskname
90 or
91 .I datestamp
92 are specified, every backup on the tape is a candidate.
93 .LP
94 .I Hostname
95 and
96 .I diskname
97 are special expression descibe in the "HOST & DISK EXPRESSION" section
98 of
99 .IR amanda (8).
100 .I Datestamp
101 are special expression describe in the "DATESTAMP EXPRESSION" section
102 of
103 .IR amanda (8).
104 For example, if
105 .I diskname
106 is "rz[23]a", it would match disks
107 .B rz2a
108 and
109 .BR rz3a .
110 .LP
111 .I Datestamp
112 is useful if
113 .B amflush
114 writes multiple backup runs to a single tape.
115 .PP
116 Unless
117 .B \-p
118 is used,
119 candidate backup images are extracted to files
120 in the current directory named:
121 .LP
122 .RS
123 .I hostname.diskname.datestamp.dumplevel
124 .RE
125 .PP
126 Amrestore doesn't use a changer, it restore from the tape already loaded
127 in the
128 .I tapedevice.
129 .SH OPTIONS
130 .TP
131 .B \-b
132 Set the blocksize used to read the tape or holding file.
133 All holding files must be read with a blocksize of 32 KBytes.
134 .B Amrestore
135 should normally be able to determine the blocksize for tapes
136 on its own and not need this parameter.
137 .IP
138 The default is 32 KBytes.
139 .TP
140 .B \-f
141 Do a rewind followed by a fsf <fileno> before trying to restore an image.
142 .TP
143 .B \-l
144 Check if we restoring from the tape with the right
145 .I label
146 .TP
147 .B \-p
148 Pipe output.
149 The first matching backup image is sent to standard output,
150 which is normally a pipe to
151 .B restore
152 or
153 .BR tar ,
154 then
155 .B amrestore
156 quits.
157 It may be run again to continue selecting backups to process.
158 Make sure you specify the no-rewind
159 .I tapedevice
160 when doing this.
161 .IP
162 Note:
163 .B restore
164 may report "short read" errors when reading from a pipe.
165 Most versions of
166 .B restore
167 support a blocking factor option to let you set the read block size,
168 and you should set it to 2.
169 See the example below.
170 .TP
171 .B \-c
172 Compress output using the fastest method the compression program provides.
173 .B Amrestore
174 normally writes output files in a format understood by
175 .B restore
176 or
177 .BR tar ,
178 even if the backups on the tape are compressed.
179 With the
180 .B \-c
181 or
182 .B \-C
183 option,
184 .B amrestore
185 writes all files in compressed format,
186 even if the backups on the tape are not compressed.
187 Output file names will have a
188 .I .Z
189 or
190 .I .gz
191 extension depending on whether
192 .B compress
193 or
194 .B gzip
195 is the preferred compression program.
196 This option is useful when the current directory disk is small.
197 .TP
198 .B \-C
199 Compress output using the best method the compression program provides
200 (may be very CPU intensive).
201 See the notes above about the
202 .B \-c
203 option.
204 .TP
205 .B \-r
206 Raw output.
207 Backup images are output exactly as they are on the tape,
208 including the
209 .B amdump
210 headers.
211 Output file names will have a
212 .I .RAW
213 extension.
214 This option is only useful for debugging and other strange circumstances.
215 .TP
216 .B \-h
217 Header output.
218 The tape header block is output at the beginning of each file.
219 This is like
220 .B \-r
221 except
222 .B \-c
223 or
224 .B \-C
225 may also be used to compress the result.
226 .B Amrecover
227 uses the header to determine the restore program to use.
228 .LP
229 If a header is written (\-r or \-h),
230 only 32 KBytes are output regardless of the tape blocksize.
231 This makes the resulting image usable as a holding file.
232 .SH EXAMPLES
233 The following does an interactive restore of disk
234 .I rz3g
235 from host
236 .IR seine ,
237 to restore particular files.
238 Note the use of the
239 .B b
240 option to
241 .BR restore ,
242 which causes it to read in units of two 512-byte blocks (1 Kbyte)
243 at a time.
244 This helps keep it from complaining about short reads.
245 .LP
246 .RS
247 .EX
248 % amrestore \-p /dev/nrmt9 seine rz3g | restore \-ivbf 2 \-
249 .EE
250 .RE
251 .LP
252 The next example extracts all backup images for host
253 .IR seine .
254 This is the usual way to extract all data for a host after a disk crash.
255 .LP
256 .RS
257 .EX
258 % amrestore /dev/nrmt9 seine
259 .EE
260 .RE
261 .LP
262 If the backup datestamp in the above example is
263 .I 19910125
264 and
265 .I seine
266 has level 0 backups of disks
267 .I rz1a
268 and
269 .I rz1g
270 on the tape,
271 these files will be created in the current directory:
272 .LP
273 .RS
274 .EX
275 seine.rz1a.19910125.0
276 seine.rz1g.19910125.0
277 .EE
278 .RE
279 .LP
280 You may also use
281 .B amrestore
282 to extract a backup image from a holding disk
283 file that has not yet been flushed to tape:
284 .LP
285 .RS
286 .EX
287 % amrestore \-p /amanda/20001119/seine.rz1a.2 | restore \-ivbf 2 \-
288 .EE
289 .RE
290 .LP
291 .B Amrestore
292 may be used to generate a listing of images on a tape:
293 .LP
294 .RS
295 .EX
296 % mt -f /dev/nrmt9 rewind
297 % amrestore \-p /dev/nrmt9 no-such-host > /dev/null
298 .EE
299 .RE
300 .LP
301 This asks
302 .B amrestore
303 to find images for host
304 .BR no-such-host .
305 It will not find any entries that match, but along the way will report
306 each image it skips.
307 .SH CAVEATS
308 .LP
309 GNU tar must be used to restore files from backup images created with
310 the GNUTAR dumptype.
311 Vendor tar programs sometimes fail to read GNU tar images.
312 .SH AUTHOR
313 James da Silva <jds@cs.umd.edu>
314 .br
315 University of Maryland, College Park
316 .SH "SEE ALSO"
317 amanda(8),
318 amdump(8),
319 amflush(8),
320 tar(1)
321 restore(8)