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