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