01608fb097c5fdc7b4411595b06b7d7099efb742
[debian/amanda] / man / amrecover.8
1 .\"     Title: amrecover
2 .\"    Author: 
3 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
4 .\"      Date: 08/22/2008
5 .\"    Manual: 
6 .\"    Source: 
7 .\"
8 .TH "AMRECOVER" "8" "08/22/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 .nf
173 settape 192\.168\.0\.10:file:/file1
174 .fi
175 You can change the tape device when amrecover ask you to load the tape:
176 .nf
177 Load tape DMP014 now
178 Continue? [Y/n/t]: t
179 Tape device: server2:/dev/nst2
180 Continue? [Y/n/t]: Y
181 Using tape /dev/nst2 from server server2\.
182 .fi
183 .RE
184 .PP
185 \fBsetmode\fR \fImode\fR
186 .RS 4
187 Set the extraction mode for Samba shares\. If
188 \fImode\fR
189 is
190 \fBsmb\fR, shares are sent to the Samba server to be restored back onto the PC\. If
191 \fImode\fR
192 is
193 \fBtar\fR, they are extracted on the local machine the same way tar volumes are extracted\.
194 .RE
195 .PP
196 \fBmode\fR
197 .RS 4
198 Displays the extracting mode for Samba shares\.
199 .RE
200 .PP
201 \fBhistory\fR
202 .RS 4
203 Show the backup history of the current host and disk\. Dates, levels, tapes and file position on tape of each backup are displayed\.
204 .RE
205 .PP
206 \fBpwd\fR
207 .RS 4
208 Display the name of the current backup working directory\.
209 .RE
210 .PP
211 \fBcd\fR \fIdir\fR
212 .RS 4
213 Change the backup working directory to
214 \fIdir\.\fR
215 If the mount point was specified with
216 \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
217 \fIdir\fR
218 can be a shell style wildcards\.
219 .RE
220 .PP
221 \fBcdx\fR \fIdir\fR
222 .RS 4
223 Like the
224 \fBcd\fR
225 command but allow regular expression\.
226 .RE
227 .PP
228 \fBlpwd\fR
229 .RS 4
230 Display the
231 \fBamrecover\fR
232 working directory\. Files will be restored under this directory, relative to the backed up filesystem\.
233 .RE
234 .PP
235 \fBlcd\fR \fIpath\fR
236 .RS 4
237 Change the
238 \fBamrecover\fR
239 working directory to
240 \fIpath\fR\.
241 .RE
242 .PP
243 \fBls\fR
244 .RS 4
245 List the contents of the current backup working directory\. See the description of the
246 \fBsetdate\fR
247 command for how the view of the directory is built up\. The backup date is shown for each file\.
248 .RE
249 .PP
250 \fBadd\fR \fIitem1 item2 \.\.\.\fR
251 .RS 4
252 Add the specified files or directories to the restore list\. Each item may have shell style wildcards\.
253 .RE
254 .PP
255 \fBaddx\fR \fIitem1 item2 \.\.\.\fR
256 .RS 4
257 Add the specified files or directories to the restore list\. Each item may be a regular expression\.
258 .RE
259 .PP
260 \fBdelete\fR \fIitem1 item2 \.\.\.\fR
261 .RS 4
262 Delete the specified files or directories from the restore list\. Each item may have shell style wildcards\.
263 .RE
264 .PP
265 \fBdeletex\fR \fIitem1 item2 \.\.\.\fR
266 .RS 4
267 Delete the specified files or directories from the restore list\. Each item may be a regular expression\.
268 .RE
269 .PP
270 \fBlist\fR \fIfile\fR
271 .RS 4
272 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
273 \fIAmanda\fR
274 tapes with
275 \fBamrestore\fR\.
276 .RE
277 .PP
278 \fBclear\fR
279 .RS 4
280 Clear the restore list\.
281 .RE
282 .PP
283 \fBquit\fR
284 .RS 4
285 Close the connection to the index server and exit\.
286 .RE
287 .PP
288 \fBexit\fR
289 .RS 4
290 Close the connection to the index server and exit\.
291 .RE
292 .PP
293 \fBextract\fR
294 .RS 4
295 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
296 \fBlpwd\fR
297 to display the local working directory, and
298 \fBlcd\fR
299 to change it\.
300 .RE
301 .PP
302 \fBhelp\fR
303 .RS 4
304 Display a brief list of these commands\.
305 .RE
306 .SH "EXAMPLES"
307 .PP
308 The following shows the recovery of an old
309 \fIsyslog\fR
310 file\.
311 .nf
312 # cd /var/log
313 # ls \-l syslog\.7
314 syslog\.7: No such file or directory
315 # amrecover
316 AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
317 220 oops \fIAmanda\fR index server (2\.4\.2) ready\.
318 Setting restore date to today (1997\-12\-09)
319 200 Working date set to 1997\-12\-09\.
320 200 Config set to daily\.
321 200 Dump host set to this\-host\.some\.org\.
322 $CWD \'/var/log\' is on disk \'/var\' mounted at \'/var\'\.
323 200 Disk set to /var\.
324 /var/log
325 WARNING: not on root of selected filesystem, check man\-page!
326 amrecover> ls
327 1997\-12\-09 daemon\.log
328 1997\-12\-09 syslog
329 1997\-12\-08 authlog
330 1997\-12\-08 sysidconfig\.log
331 1997\-12\-08 syslog\.0
332 1997\-12\-08 syslog\.1
333 1997\-12\-08 syslog\.2
334 1997\-12\-08 syslog\.3
335 1997\-12\-08 syslog\.4
336 1997\-12\-08 syslog\.5
337 1997\-12\-08 syslog\.6
338 1997\-12\-08 syslog\.7
339 amrecover> add syslog\.7
340 Added /log/syslog\.7
341 amrecover> lpwd
342 /var/log
343 amrecover> lcd \.\.
344 /var
345 amrecover> extract
346
347 Extracting files using tape drive /dev/nst0 on host 192\.168\.0\.10
348
349 The following tapes are needed: DMP014
350
351 Restoring files into directory /var
352 Continue? [Y/n]: y
353
354 Load tape DMP014 now
355 Continue? [Y/n/t]: y
356 set owner/mode for \'\.\'? [yn] n
357 amrecover> quit
358 200 Good bye\.
359 # ls \-l syslog\.7
360 total 26
361 \-rw\-r\-\-r\-\-   1 root     other      12678 Oct 14 16:36 syslog\.7
362 .fi
363 .PP
364 If you do not want to overwrite existing files, create a subdirectory to run
365 \fBamrecover\fR
366 from and then move the restored files afterward\.
367 .nf
368 # cd /var
369 # (umask 077 ; mkdir \.restore)
370 # cd \.restore
371 # amrecover
372 AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
373 \.\.\.
374 amrecover> cd log
375 /var/log
376 amrecover> ls
377 \.\.\.
378 amrecover> add syslog\.7
379 Added /log/syslog\.7
380 amrecover> lpwd
381 /var/\.restore
382 amrecover> extract
383
384 Extracting files using tape drive /dev/nst0 on host 192\.168\.0\.10
385 \.\.\.
386 amrecover> quit
387 200 Good bye\.
388 # mv \-i log/syslog\.7 \.\./log/syslog\.7\-restored
389 # cd \.\.
390 # rm \-fr \.restore
391 .fi
392 .PP
393 If you need to run
394 \fBamrestore\fR
395 by hand instead of letting
396 \fBamrecover\fR
397 control it, use the
398 \fBlist\fR
399 command after browsing to display the needed tapes\.
400 .nf
401 # cd /var/log
402 # amrecover
403 AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
404 \.\.\.
405 amrecover> ls
406 \.\.\.
407 amrecover> add syslog syslog\.6 syslog\.7
408 Added /log/syslog
409 Added /log/syslog\.6
410 Added /log/syslog\.7
411 amrecover> list
412 TAPE DMP014 LEVEL 0 DATE 1997\-12\-08
413         /log/syslog\.7
414         /log/syslog\.6
415 TAPE DMP015 LEVEL 1 DATE 1997\-12\-09
416         /log/syslog
417 amrecover> quit 
418 .fi
419 .PP
420 The
421 \fBhistory\fR
422 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\.
423 .PP
424 Tape file position zero is a label\. The first backup image is in file position one\.
425 .nf
426 # cd /var/log
427 # amrecover
428 AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
429 \.\.\.
430 amrecover> history
431 200\- Dump history for config "daily" host "this\-host\.some\.org" disk "/var"
432 201\- 1997\-12\-09 1 DMP015 9
433 201\- 1997\-12\-08 1 DMP014 11
434 201\- 1997\-12\-07 0 DMP013 22
435 201\- 1997\-12\-06 1 DMP012 16
436 201\- 1997\-12\-05 1 DMP011 9
437 201\- 1997\-12\-04 0 DMP010 11
438 201\- 1997\-12\-03 1 DMP009 7
439 201\- 1997\-12\-02 1 DMP008 7
440 201\- 1997\-12\-01 1 DMP007 9
441 201\- 1997\-11\-30 1 DMP006 6
442 \.\.\.
443 amrecover> quit 
444 .fi
445 .SH "ENVIRONMENT"
446 .PP
447 \fBPAGER\fR
448 The
449 \fBls\fR
450 and
451 \fBlist\fR
452 commands will use $PAGER to display the file lists\. Defaults to
453 \fImore\fR
454 if PAGER is not set\.
455 .PP
456 \fBAMANDA_SERVER\fR
457 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\.
458 .PP
459 \fBAMANDA_TAPE_SERVER\fR
460 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\.
461 .SH "AUTHOR"
462 .PP
463 Alan M\. McIvor
464 <alan@kauri\.auck\.irl\.cri\.nz>
465 : Original text
466 .PP
467 Stefan G\. Weichinger,
468 <sgw@amanda\.org>, maintainer of the
469 \fIAmanda\fR\-documentation: XML\-conversion
470 .SH "SEE ALSO"
471 .PP
472 \fBamanda\fR(8),
473 \fBamanda-client.conf\fR(5),
474 \fBamrestore\fR(8),
475 \fBamfetchdump\fR(8),
476 \fBreadline\fR(3),
477 : http://wiki.zmanda.com