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