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