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