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