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