Imported Upstream version 2.5.1
[debian/amanda] / man / amrestore.8
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "AMRESTORE" 8 "" "" ""
21 .SH "NAME"
22 amrestore - extract backup images from an Amanda tape
23 .SH "SYNOPSIS"
24 .HP 10
25 \fBamrestore\fR [-r -c -C] [-b \fIblocksize\fR] [-f \fIfileno\fR] [-l \fIlabel\fR] [-p] [-h] \fItapedevice\fR| \fIholdingfile\fR  [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR ...]]]]]]
26 .SH "DESCRIPTION"
27 .PP
28 \fBAmrestore\fR
29 extracts backup images from the tape mounted on
30 \fBtapedevice\fR
31 or from the holding disk file
32 \fBholdingfile\fR
33 that match
34 \fBhostname\fR,
35 \fBdiskname\fR
36 and
37 \fBdatestamp\fR
38 patterns given on the command line. The tape or holding file must be in a format written by the
39 \fBamdump\fR
40 or
41 \fBamflush\fR
42 program.
43 .PP
44 If
45 \fBdiskname\fR
46 is not specified, all backups on the tape for the previous
47 \fBhostname\fR
48 are candidates. If
49 \fBdatestamp\fR
50 is not specified, all backups on the tape for the previous
51 \fBhostname\fR
52 and
53 \fBdiskname\fR
54 are candidates. If no
55 \fBhostname\fR,
56 \fBdiskname\fR
57 or
58 \fBdatestamp\fR
59 are specified, every backup on the tape is a candidate.
60 .PP
61 \fBHostname\fR
62 and
63 \fBdiskname\fR
64 are special expressions described in the "HOST & DISK EXPRESSION" section of
65 \fBamanda\fR(8).
66 \fBDatestamp\fR
67 are special expression described in the "DATESTAMP EXPRESSION" section of
68 \fBamanda\fR(8). For example, if
69 \fBdiskname\fR
70 is "rz[23]a", it would match disks
71 \fBrz2a\fR
72 and
73 \fBrz3a\fR.
74 .PP
75 \fBDatestamp\fR
76 is useful if
77 \fBamflush\fR
78 writes multiple backup runs to a single tape.
79 .PP
80 Unless
81 \fB-p\fR
82 is used, candidate backup images are extracted to files in the current directory named:
83 .PP
84 \fBhostname.diskname.datestamp.dumplevel\fR
85 .PP
86 Amrestore doesn't use a changer, it restore from the tape already loaded in the
87 \fBtapedevice.\fR
88 .SH "OPTIONS"
89 .TP
90 \fB-b\fR
91 Set the blocksize used to read the tape or holding file. All holding files must be read with a blocksize of 32 KBytes.
92 \fBAmrestore\fR
93 should normally be able to determine the blocksize for tapes on its own and not need this parameter.
94 .PP
95 The default is 32 KBytes.
96 .TP
97 \fB-f\fR
98 Do a rewind followed by a fsf <fileno> before trying to restore an image.
99 .TP
100 \fB-l\fR
101 Check if we restoring from the tape with the right
102 \fBlabel\fR
103 .TP
104 \fB-p\fR
105 Pipe output. The first matching backup image is sent to standard output, which is normally a pipe to
106 \fBrestore\fR
107 or
108 \fBtar\fR, then
109 \fBamrestore\fR
110 quits. It may be run again to continue selecting backups to process. Make sure you specify the no-rewind
111 \fBtapedevice\fR
112 when doing this.
113 .PP
114 Note:
115 \fBrestore\fR
116 may report "short read" errors when reading from a pipe. Most versions of
117 \fBrestore\fR
118 support a blocking factor option to let you set the read block size, and you should set it to 2. See the example below.
119 .TP
120 \fB-c\fR
121 Compress output using the fastest method the compression program provides.
122 \fBAmrestore\fR
123 normally writes output files in a format understood by
124 \fBrestore\fR
125 or
126 \fBtar\fR, even if the backups on the tape are compressed. With the
127 \fB-c\fR
128 or
129 \fB-C\fR
130 option,
131 \fBamrestore\fR
132 writes all files in compressed format, even if the backups on the tape are not compressed. Output file names will have a
133 .Z
134 or
135 .gz
136 extension depending on whether
137 \fBcompress\fR
138 or
139 \fBgzip\fR
140 is the preferred compression program. This option is useful when the current directory disk is small.
141 .TP
142 \fB-C\fR
143 Compress output using the best method the compression program provides (may be very CPU intensive). See the notes above about the
144 \fB-c\fR
145 option.
146 .TP
147 \fB-r\fR
148 Raw output. Backup images are output exactly as they are on the tape, including the
149 \fBamdump\fR
150 headers. Output file names will have a
151 .RAW
152 extension. This option is only useful for debugging and other strange circumstances.
153 .TP
154 \fB-h\fR
155 Header output. The tape header block is output at the beginning of each file. This is like
156 \fB-r\fR
157 except
158 \fB-c\fR
159 or
160 \fB-C\fR
161 may also be used to compress the result.
162 \fBAmrecover\fR
163 uses the header to determine the restore program to use.
164 .PP
165 If a header is written (-r or -h), only 32 KBytes are output regardless of the tape blocksize. This makes the resulting image usable as a holding file.
166 .TP
167 \fB-o\fR \fIconfigoption\fR
168 See the "\fBCONFIGURATION OVERWRITE\fR" section in
169 \fBamanda\fR(8).
170 .SH "EXAMPLES"
171 .PP
172 The following does an interactive restore of disk
173 \fBrz3g\fR
174 from host
175 \fBseine\fR, to restore particular files. Note the use of the
176 \fBb\fR
177 option to
178 \fBrestore\fR, which causes it to read in units of two 512-byte blocks (1 Kbyte) at a time. This helps keep it from complaining about short reads.
179 .sp
180 .nf
181
182 % amrestore -p /dev/nrmt9 seine rz3g | restore -ivbf 2 -
183
184 .fi
185 .sp
186 .PP
187 The next example extracts all backup images for host
188 \fBseine\fR. This is the usual way to extract all data for a host after a disk crash.
189 .sp
190 .nf
191
192 % amrestore /dev/nrmt9 seine
193
194 .fi
195 .sp
196 .PP
197 If the backup datestamp in the above example is
198 19910125
199 and
200 \fBseine\fR
201 has level 0 backups of disks
202 \fBrz1a\fR
203 and
204 \fBrz1g\fR
205 on the tape, these files will be created in the current directory:
206 .sp
207 .nf
208
209 seine.rz1a.19910125.0
210 seine.rz1g.19910125.0
211
212 .fi
213 .sp
214 .PP
215 You may also use
216 \fBamrestore\fR
217 to extract a backup image from a holding disk file that has not yet been flushed to tape:
218 .sp
219 .nf
220
221 % amrestore -p /amanda/20001119/seine.rz1a.2 | restore -ivbf 2 -
222
223 .fi
224 .sp
225 .PP
226 \fBAmrestore\fR
227 may be used to generate a listing of images on a tape:
228 .sp
229 .nf
230
231 % mt -f /dev/nrmt9 rewind
232 % amrestore -p /dev/nrmt9 no-such-host > /dev/null
233
234 .fi
235 .sp
236 .PP
237 This asks
238 \fBamrestore\fR
239 to find images for host
240 \fBno-such-host\fR. It will not find any entries that match, but along the way will report each image it skips.
241 .SH "CAVEATS"
242 .PP
243 \fBGNU-tar\fR
244 must be used to restore files from backup images created with the GNUTAR dumptype. Vendor tar programs sometimes fail to read GNU tar images.
245 .SH "AUTHOR"
246 .PP
247 James da Silva,
248 <jds@amanda.org>, University of Maryland, College Park: Original text
249 .PP
250 Stefan G. Weichinger,
251 <sgw@amanda.org>, maintainer of the
252 \fBAmanda\fR-documentation: XML-conversion
253 .SH "SEE ALSO"
254 .PP
255 \fBamanda\fR(8),
256 \fBamdump\fR(8),
257 \fBamflush\fR(8),
258 \fBtar\fR(1)\fBrestore\fR(8)
259