Imported Upstream version 3.1.0
[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 '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>low-level data-extraction from Amanda volumes</refpurpose>
23 </refnamediv>
24 <refentryinfo>
25 &author.jds;
26 &author.sgw.xml;
27 &author.dustin;
28 </refentryinfo>
29 <!-- body begins here -->
30 <refsynopsisdiv>
31 <cmdsynopsis>
32   <command>amrestore</command>    
33     <arg choice='opt'>--config <replaceable>config</replaceable></arg>
34     <group choice='opt'><arg choice='plain'>-r </arg><arg choice='plain'>-c </arg><arg choice='plain'>-C </arg></group>
35     <arg choice='opt'>-b <replaceable>blocksize</replaceable></arg>
36     <arg choice='opt'>-f <replaceable>filenum</replaceable></arg>
37     <arg choice='opt'>-l <replaceable>label</replaceable></arg>
38     <arg choice='opt'>-p</arg>
39     <arg choice='opt'>-h</arg>
40     &configoverride.synopsis;
41     <group>
42       <arg choice='req'><replaceable>changerspec</replaceable></arg>
43       <arg choice='req'><arg choice='opt'>--holding</arg>
44         <replaceable>holdingfile</replaceable></arg>
45     </group>
46     <arg choice='opt'>
47       <replaceable>hostname</replaceable>
48       <arg choice='opt'>
49         <replaceable>diskname</replaceable>
50         <arg choice='opt'>
51           <replaceable>datestamp</replaceable>
52           <arg choice='opt'>
53             <replaceable>hostname</replaceable>
54             <arg choice='opt'>
55               <replaceable>diskname</replaceable>
56               <arg choice='opt'>
57                 <replaceable>datestamp</replaceable>
58                 ...
59               </arg>
60             </arg>
61           </arg>
62         </arg>
63       </arg>
64     </arg>
65 </cmdsynopsis>
66
67 <para>Note that this is the only Amanda command which does not take a configuration name as its first argument.</para>
68
69 </refsynopsisdiv>
70
71 <refsect1><title>DESCRIPTION</title>
72
73 <para><emphasis>Amrestore</emphasis> is a very low-level tool for extracting
74 data from Amanda volumes.  It does not consult any catalog information or other
75 metadata, basing its operations only on the headers found on the volume.  This
76 makes it an appropriate tool for bare-metal restores of an Amanda server, or
77 other situations where the catalog is not available.</para>
78
79 <para>See <manref name="amfetchdump" vol="8"/> and <manref name="amrecover"
80 vol="8"/> for higher-level recoveries.</para>
81
82 <para>The tool does not reassemble split dumps, but can uncompress compressed
83 dumps.  Note that decompression may fail for split parts after the first.  If
84 this occurs, extract the parts without decompressing, concatenate them, and
85 decompress the result.</para>
86
87 <para>Data is restored from the current volume in
88 <replaceable>changerspec</replaceable>, or from the holding file
89 <replaceable>holdingfile</replaceable>.  In most cases,
90 <replaceable>changerspec</replaceable> will name a particular device, e.g.,
91 <computeroutput>tape:/dev/nst0</computeroutput> or
92 <computeroutput>s3:mybucket/tape-1</computeroutput>.</para>
93
94 <para>Only dumps matching the dump specification beginning with
95 <replaceable>hostname</replaceable> are extracted.  If no specification is
96 given, every file on the volume (or the entire holdingfile) is restored.  See
97 the "HOST &amp; DISK EXPRESSIONS" section of <manref name="amanda" vol="8"/>
98 for the format of the <replaceable>hostname</replaceable> and
99 <replaceable>diskname</replaceable> parameters, and the "DATESTAMP EXPRESSIONS"
100 section for the format of the <replaceable>datestamp</replaceable>
101 parameters.</para>
102
103 <para>Unless <option>-p</option> is used, candidate backup images are extracted
104 to files in the current directory named:
105 <filename>hostname.diskname.datestamp.dumplevel</filename></para>
106
107 </refsect1>
108
109 <refsect1><title>OPTIONS</title>
110 <variablelist>
111
112 <varlistentry>
113 <term><option>-b <replaceable>blocksize</replaceable></option></term>
114 <listitem>
115 <para>Use the given blocksize to read the volume.  The default is defined by the
116 device.</para>
117 </listitem>
118 </varlistentry>
119
120 <varlistentry>
121 <term><option>-f <replaceable>filenum</replaceable></option></term>
122 <listitem>
123 <para>Seek to file <replaceable>filenum</replaceable> before beginning the
124 restore operation.</para>
125 </listitem>
126 </varlistentry>
127
128 <varlistentry>
129 <term><option>-l <replaceable>label</replaceable></option></term>
130 <listitem>
131 <para>Check that the volume has label <replaceable>label</replaceable>.</para>
132 </listitem>
133 </varlistentry>
134
135 <varlistentry>
136 <term><option>-p</option></term>
137 <listitem>
138 <para>Pipe the first matching file to standard output.  This is typically used
139 in a shell pipeline to send the data to a process like <command>tar</command> for
140 extraction.</para>
141 </listitem>
142 </varlistentry>
143
144 <varlistentry>
145 <term><option>-c</option></term>
146 <term><option>-C</option></term>
147 <listitem>
148 <para>If the file is not already compressed, compress it using the fastest
149 (<option>-c</option>) or best (<option>-C</option>) compression algorithm.
150 Note that <command>amrestore</command> will not re-compress an
151 already-compressed file.  Without either of these options,
152 <command>amrestore</command> will automatically uncompress any compressed
153 files.  This option is useful when the destination disk is small.</para>
154 </listitem>
155 </varlistentry>
156
157 <varlistentry>
158 <term><option>-h</option></term>
159 <listitem>
160 <para>Include 32k headers on all output files, similar to a holding file.  This
161 header can be read by another application or utility (see
162 <command>Amanda::Header</command>) during the next phase of processing.</para>
163 </listitem>
164 </varlistentry>
165
166 <varlistentry>
167 <term><option>-r</option></term>
168 <listitem>
169 <para>Output raw files.  This is similar to <option>-h</option>, but also
170 disables any automatic decompression.  Output file names will have a
171 <filename>.RAW</filename> extension.</para>
172 </listitem>
173 </varlistentry>
174
175   &configoverride.varlistentry;
176
177 </variablelist>
178
179 </refsect1>
180
181 <refsect1><title>EXAMPLES</title>
182
183 <para>The following does an interactive restore of disk
184 <emphasis>rz3g</emphasis> from host <emphasis>seine</emphasis>, to restore
185 particular files.  Note the use of the <emphasis>b</emphasis> option to
186 <emphasis>restore</emphasis>, which causes it to read in units of two 512-byte
187 blocks (1 Kbyte) at a time.  This helps keep it from complaining about short
188 reads.</para>
189
190 <programlisting>
191   amrestore -p /dev/nrmt9 seine rz3g | tar -xv
192 </programlisting>
193
194 <para>The next example extracts all backup images for host
195 <emphasis>seine</emphasis>.  This is a typical way to extract all data for a
196 host after a disk crash.</para>
197
198 <programlisting>
199   amrestore /dev/nrmt9 seine
200 </programlisting>
201
202 <para>If the backup datestamp in the above example is
203 <literal>20070125</literal> and <emphasis>seine</emphasis> has level 0 backups
204 of disks <emphasis>rz1a</emphasis> and <emphasis>rz1g</emphasis> on the tape,
205 these files will be created in the current directory:</para>
206
207 <programlisting>
208   seine.rz1a.19910125.0
209   seine.rz1g.19910125.0
210 </programlisting>
211
212 <para>You may also use <command>amrestore</command> to extract a backup image
213 from a holding disk file that has not yet been flushed to tape:</para>
214
215 <programlisting>
216   amrestore -p /amanda/20001119/seine.rz1a.2 | tar -xv
217 </programlisting>
218
219 </refsect1>
220
221 <refsect1><title>CAVEATS</title>
222
223 <para>&gnutar; must be used to restore files from backup images created with
224 the GNUTAR dumptype.  Vendor tar programs sometimes fail to read GNU Tar
225 images.</para>
226
227 </refsect1>
228
229 <seealso>
230 <manref name="amfetchdump" vol="8"/>,
231 <manref name="amrecover" vol="8"/>,
232 </seealso>
233
234 </refentry>
235