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