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