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