Imported Upstream version 2.6.0p1
[debian/amanda] / man / amrecover.8
1 .\"     Title: amrecover
2 .\"    Author: 
3 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
4 .\"      Date: 05/14/2008
5 .\"    Manual: 
6 .\"    Source: 
7 .\"
8 .TH "AMRECOVER" "8" "05/14/2008" "" ""
9 .\" disable hyphenation
10 .nh
11 .\" disable justification (adjust text to left margin only)
12 .ad l
13 .SH "NAME"
14 amrecover - Amanda index database browser
15 .SH "SYNOPSIS"
16 .HP 10
17 \fBamrecover\fR [\-C\ \fIconfig\fR] [\-s\ \fIindex\-server\fR] [\-t\ \fItape\-server\fR] [\-d\ \fItape\-device\fR] [\-o\ \fIconfigoption\fR]...
18 .SH "DESCRIPTION"
19 .PP
20 \fBAmrecover\fR
21 browses the database of
22 \fIAmanda\fR
23 index files to determine which tapes contain files to recover\. Furthermore, it is able to recover files\.
24 .PP
25 In order to restore files in place, you must invoke
26 \fBamrecover\fR
27 from the root of the backed up filesystem, or use
28 \fBlcd\fR
29 to move into that directory, otherwise a directory tree that resembles the backed up filesystem will be created in the current directory\. See the examples below for details\.
30 .PP
31 Amrecover will read the
32 \fBamanda\-client\.conf\fR
33 file and the
34 \fIconfig\fR\fB/amanda\-client\.conf\fR
35 file\.
36 .PP
37 See the
38 \fBamanda\fR(8)
39 man page for more details about
40 \fIAmanda\fR\.
41 .SH "OPTIONS"
42 .sp
43 .it 1 an-trap
44 .nr an-no-space-flag 1
45 .nr an-break-flag 1
46 .br
47 Note
48 .PP
49 The Default values are those set at compile\-time\. Use
50 \fBamrestore\fR
51 to recover client\-encrypted or client\-custom\-compressed tapes\.
52 .PP
53 \fB[ \-C ] config\fR
54 .RS 4
55 \fIAmanda\fR
56 configuration\.
57 .RE
58 .PP
59 \fB\-s index\-server\fR
60 .RS 4
61 Host that runs the index daemon\.
62 .RE
63 .PP
64 \fB\-t tape\-server\fR
65 .RS 4
66 Host that runs the tape server daemon\.
67 .RE
68 .PP
69 \fB\-d tape\-device\fR
70 .RS 4
71 Tape device to use on the tape server host\.
72 .RE
73 .PP
74 \fB\-o\fR \fIclientconfigoption\fR
75 .RS 4
76 See the "\fBCONFIGURATION OVERRIDE\fR" section in
77 \fBamanda\fR(8)\.
78 .RE
79 .SH "COMMANDS"
80 .PP
81 \fBAmrecover\fR
82 connects to the index server and then presents a command line prompt\. Usage is similar to an ftp client\. The GNU readline library is used to provide command line history and editing if it was built in to
83 \fBamrecover\fR\.
84 .PP
85 The purpose of browsing the database is to build up a
86 \fIrestore list\fR
87 of files to be extracted from the backup system\. The following commands are available:
88 .PP
89 \fBsethost hostname\fR
90 .RS 4
91 Specifies which host to look at backup files for (default: the local host)\.
92 .RE
93 .PP
94 \fBsetdate YYYY\-MM\-DD\-HH\-MM[\-SS] | YYYY\-MM\-DD\fR
95 .RS 4
96 Set the restore time (default: now)\. File listing commands only return information on backup images for this day, for the day before with the next lower dump level, and so on, until the most recent level 0 backup on or before the specified date is encountered\.
97 .sp
98 For example, if:
99 .sp
100 .RS 4
101 .nf
102 1996\-07\-01 was a level 0 backup
103 1996\-07\-02 through 1996\-07\-05 were level 1 backups
104 1996\-07\-06 through 1997\-07\-08 were level 2 backups
105 .fi
106 .RE
107 .sp
108 then the command
109 \fBsetdate 1997\-07\-08\-00\fR
110 would yield files from the following days:
111 .sp
112 .RS 4
113 .nf
114 1997\-07\-08 (the latest level 2 backup)
115 1997\-07\-05 (the latest level 1 backup)
116 1997\-07\-01 (the latest level 0 backup)
117 .fi
118 .RE
119 .sp
120 Only the most recent version of a file will be presented\.
121 .sp
122 The following abbreviated date specifications are accepted:
123 .PP
124 \fB\-\-MM\-DD\fR
125 .RS 4
126 dates in the current year
127 .RE
128 .PP
129 \fB\-\-\-DD\fR
130 .RS 4
131 dates in the current month of the current year
132 .RE
133 .RE
134 .PP
135 \fBsetdisk\fR \fIdiskname\fR [\fImountpoint\fR]
136 .RS 4
137 Specifies which disk to consider (default: the disk holding the working directory where
138 \fBamrecover\fR
139 is started)\. It can only be set after the host is set with
140 \fBsethost\fR\.
141 \fIDiskname\fR
142 is the device name specified in the
143 \fIamanda\.conf\fR
144 or
145 \fIdisklist\fR
146 configuration file\. The disk must be local to the host\. If
147 \fImountpoint\fR
148 is not specified, all pathnames will be relative to the (unknown) mount point instead of full pathnames\.
149 .RE
150 .PP
151 \fBlisthost\fR [\fIdiskdevice\fR]
152 .RS 4
153 List all
154 \fBhost\fR
155 .RE
156 .PP
157 \fBlistdisk\fR [\fIdiskdevice\fR]
158 .RS 4
159 List all
160 \fBdiskname\fR
161 .RE
162 .PP
163 \fBsetdevice\fR [[\-h \fItape\-server\fR] \fItapedev\fR]
164 .RS 4
165 Specifies the host to use as the tape server, and which of its tape devices to use\. If the server is omitted, the server name reverts to the configure\-time default\. If the tape device is omitted, the default is used\.
166 .sp
167 If you want amrecover to use your changer, the
168 \fItapedev\fR
169 must be equal to the amrecover_changer setting on the server\.
170 .sp
171 If you need to change the protocol (tape:, rait:, file:, null:) then you must specify the hostname\.
172 .sp
173 .RS 4
174 .nf
175 settape 192\.168\.0\.10:file:/file1
176 .fi
177 .RE
178 You can change the tape device when amrecover ask you to load the tape:
179 .sp
180 .RS 4
181 .nf
182 Load tape DMP014 now
183 Continue? [Y/n/t]: t
184 Tape device: server2:/dev/nst2
185 Continue? [Y/n/t]: Y
186 Using tape /dev/nst2 from server server2\.
187 .fi
188 .RE
189 .RE
190 .PP
191 \fBsetmode\fR \fImode\fR
192 .RS 4
193 Set the extraction mode for Samba shares\. If
194 \fImode\fR
195 is
196 \fBsmb\fR, shares are sent to the Samba server to be restored back onto the PC\. If
197 \fImode\fR
198 is
199 \fBtar\fR, they are extracted on the local machine the same way tar volumes are extracted\.
200 .RE
201 .PP
202 \fBmode\fR
203 .RS 4
204 Displays the extracting mode for Samba shares\.
205 .RE
206 .PP
207 \fBhistory\fR
208 .RS 4
209 Show the backup history of the current host and disk\. Dates, levels, tapes and file position on tape of each backup are displayed\.
210 .RE
211 .PP
212 \fBpwd\fR
213 .RS 4
214 Display the name of the current backup working directory\.
215 .RE
216 .PP
217 \fBcd\fR \fIdir\fR
218 .RS 4
219 Change the backup working directory to
220 \fIdir\.\fR
221 If the mount point was specified with
222 \fBsetdisk\fR, this can be a full pathname or it can be relative to the current backup working directory\. If the mount point was not specified, paths are relative to the mount point if they start with "/", otherwise they are relative to the current backup working directory\. The
223 \fIdir\fR
224 can be a shell style wildcards\.
225 .RE
226 .PP
227 \fBcdx\fR \fIdir\fR
228 .RS 4
229 Like the
230 \fBcd\fR
231 command but allow regular expression\.
232 .RE
233 .PP
234 \fBlpwd\fR
235 .RS 4
236 Display the
237 \fBamrecover\fR
238 working directory\. Files will be restored under this directory, relative to the backed up filesystem\.
239 .RE
240 .PP
241 \fBlcd\fR \fIpath\fR
242 .RS 4
243 Change the
244 \fBamrecover\fR
245 working directory to
246 \fIpath\fR\.
247 .RE
248 .PP
249 \fBls\fR
250 .RS 4
251 List the contents of the current backup working directory\. See the description of the
252 \fBsetdate\fR
253 command for how the view of the directory is built up\. The backup date is shown for each file\.
254 .RE
255 .PP
256 \fBadd\fR \fIitem1 item2 \.\.\.\fR
257 .RS 4
258 Add the specified files or directories to the restore list\. Each item may have shell style wildcards\.
259 .RE
260 .PP
261 \fBaddx\fR \fIitem1 item2 \.\.\.\fR
262 .RS 4
263 Add the specified files or directories to the restore list\. Each item may be a regular expression\.
264 .RE
265 .PP
266 \fBdelete\fR \fIitem1 item2 \.\.\.\fR
267 .RS 4
268 Delete the specified files or directories from the restore list\. Each item may have shell style wildcards\.
269 .RE
270 .PP
271 \fBdeletex\fR \fIitem1 item2 \.\.\.\fR
272 .RS 4
273 Delete the specified files or directories from the restore list\. Each item may be a regular expression\.
274 .RE
275 .PP
276 \fBlist\fR \fIfile\fR
277 .RS 4
278 Display the contents of the restore list\. If a file name is specified, the restore list is written to that file\. This can be used to manually extract the files from the
279 \fIAmanda\fR
280 tapes with
281 \fBamrestore\fR\.
282 .RE
283 .PP
284 \fBclear\fR
285 .RS 4
286 Clear the restore list\.
287 .RE
288 .PP
289 \fBquit\fR
290 .RS 4
291 Close the connection to the index server and exit\.
292 .RE
293 .PP
294 \fBexit\fR
295 .RS 4
296 Close the connection to the index server and exit\.
297 .RE
298 .PP
299 \fBextract\fR
300 .RS 4
301 Start the extract sequence (see the examples below)\. Make sure the local working directory is the root of the backed up filesystem, or another directory that will behave like that\. Use
302 \fBlpwd\fR
303 to display the local working directory, and
304 \fBlcd\fR
305 to change it\.
306 .RE
307 .PP
308 \fBhelp\fR
309 .RS 4
310 Display a brief list of these commands\.
311 .RE
312 .SH "EXAMPLES"
313 .PP
314 The following shows the recovery of an old
315 \fIsyslog\fR
316 file\.
317 .sp
318 .RS 4
319 .nf
320 # cd /var/log
321 # ls \-l syslog\.7
322 syslog\.7: No such file or directory
323 # amrecover
324 AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
325 220 oops \fIAmanda\fR index server (2\.4\.2) ready\.
326 Setting restore date to today (1997\-12\-09)
327 200 Working date set to 1997\-12\-09\.
328 200 Config set to daily\.
329 200 Dump host set to this\-host\.some\.org\.
330 $CWD \'/var/log\' is on disk \'/var\' mounted at \'/var\'\.
331 200 Disk set to /var\.
332 /var/log
333 WARNING: not on root of selected filesystem, check man\-page!
334 amrecover> ls
335 1997\-12\-09 daemon\.log
336 1997\-12\-09 syslog
337 1997\-12\-08 authlog
338 1997\-12\-08 sysidconfig\.log
339 1997\-12\-08 syslog\.0
340 1997\-12\-08 syslog\.1
341 1997\-12\-08 syslog\.2
342 1997\-12\-08 syslog\.3
343 1997\-12\-08 syslog\.4
344 1997\-12\-08 syslog\.5
345 1997\-12\-08 syslog\.6
346 1997\-12\-08 syslog\.7
347 amrecover> add syslog\.7
348 Added /log/syslog\.7
349 amrecover> lpwd
350 /var/log
351 amrecover> lcd \.\.
352 /var
353 amrecover> extract
354
355 Extracting files using tape drive /dev/nst0 on host 192\.168\.0\.10
356
357 The following tapes are needed: DMP014
358
359 Restoring files into directory /var
360 Continue? [Y/n]: y
361
362 Load tape DMP014 now
363 Continue? [Y/n/t]: y
364 set owner/mode for \'\.\'? [yn] n
365 amrecover> quit
366 200 Good bye\.
367 # ls \-l syslog\.7
368 total 26
369 \-rw\-r\-\-r\-\-   1 root     other      12678 Oct 14 16:36 syslog\.7
370 .fi
371 .RE
372 .PP
373 If you do not want to overwrite existing files, create a subdirectory to run
374 \fBamrecover\fR
375 from and then move the restored files afterward\.
376 .sp
377 .RS 4
378 .nf
379 # cd /var
380 # (umask 077 ; mkdir \.restore)
381 # cd \.restore
382 # amrecover
383 AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
384 \.\.\.
385 amrecover> cd log
386 /var/log
387 amrecover> ls
388 \.\.\.
389 amrecover> add syslog\.7
390 Added /log/syslog\.7
391 amrecover> lpwd
392 /var/\.restore
393 amrecover> extract
394
395 Extracting files using tape drive /dev/nst0 on host 192\.168\.0\.10
396 \.\.\.
397 amrecover> quit
398 200 Good bye\.
399 # mv \-i log/syslog\.7 \.\./log/syslog\.7\-restored
400 # cd \.\.
401 # rm \-fr \.restore
402 .fi
403 .RE
404 .PP
405 If you need to run
406 \fBamrestore\fR
407 by hand instead of letting
408 \fBamrecover\fR
409 control it, use the
410 \fBlist\fR
411 command after browsing to display the needed tapes\.
412 .sp
413 .RS 4
414 .nf
415 # cd /var/log
416 # amrecover
417 AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
418 \.\.\.
419 amrecover> ls
420 \.\.\.
421 amrecover> add syslog syslog\.6 syslog\.7
422 Added /log/syslog
423 Added /log/syslog\.6
424 Added /log/syslog\.7
425 amrecover> list
426 TAPE DMP014 LEVEL 0 DATE 1997\-12\-08
427         /log/syslog\.7
428         /log/syslog\.6
429 TAPE DMP015 LEVEL 1 DATE 1997\-12\-09
430         /log/syslog
431 amrecover> quit 
432 .fi
433 .RE
434 .PP
435 The
436 \fBhistory\fR
437 command shows each tape that has a backup of the current disk along with the date of the backup, the level, the tape label and the file position on the tape\. All active tapes are listed, not just back to the most recent full dump\.
438 .PP
439 Tape file position zero is a label\. The first backup image is in file position one\.
440 .sp
441 .RS 4
442 .nf
443 # cd /var/log
444 # amrecover
445 AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
446 \.\.\.
447 amrecover> history
448 200\- Dump history for config "daily" host "this\-host\.some\.org" disk "/var"
449 201\- 1997\-12\-09 1 DMP015 9
450 201\- 1997\-12\-08 1 DMP014 11
451 201\- 1997\-12\-07 0 DMP013 22
452 201\- 1997\-12\-06 1 DMP012 16
453 201\- 1997\-12\-05 1 DMP011 9
454 201\- 1997\-12\-04 0 DMP010 11
455 201\- 1997\-12\-03 1 DMP009 7
456 201\- 1997\-12\-02 1 DMP008 7
457 201\- 1997\-12\-01 1 DMP007 9
458 201\- 1997\-11\-30 1 DMP006 6
459 \.\.\.
460 amrecover> quit 
461 .fi
462 .RE
463 .SH "ENVIRONMENT"
464 .PP
465 \fBPAGER\fR
466 The
467 \fBls\fR
468 and
469 \fBlist\fR
470 commands will use $PAGER to display the file lists\. Defaults to
471 \fImore\fR
472 if PAGER is not set\.
473 .PP
474 \fBAMANDA_SERVER\fR
475 If set, $AMANDA_SERVER will be used as index\-server\. The value will take precedence over the compiled default, but will be overridden by the \-s switch\.
476 .PP
477 \fBAMANDA_TAPE_SERVER\fR
478 If set, $AMANDA_TAPE_SERVER will be used as tape\-server\. The value will take precedence over the compiled default, but will be overridden by the \-t switch\.
479 .SH "AUTHOR"
480 .PP
481 Alan M\. McIvor
482 <alan@kauri\.auck\.irl\.cri\.nz>
483 : Original text
484 .PP
485 Stefan G\. Weichinger,
486 <sgw@amanda\.org>, maintainer of the
487 \fIAmanda\fR\-documentation: XML\-conversion
488 .SH "SEE ALSO"
489 .PP
490 \fBamanda\fR(8),
491 \fBamanda-client.conf\fR(5),
492 \fBamrestore\fR(8),
493 \fBamfetchdump\fR(8),
494 \fBreadline\fR(3),
495 \fI\%http://wiki.zmanda.com\fR