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