Imported Upstream version 3.3.1
[debian/amanda] / man / xml-source / amrecover.8.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3                    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
4 [
5   <!-- entities files to use -->
6   <!ENTITY % global_entities SYSTEM 'global.entities'>
7   %global_entities;
8 ]>
9
10 <!-- lifted from troff+man by doclifter -->
11 <refentry id='amrecover.8'>
12
13 <!-- P1 listing suppressed (not used) -->
14 <refmeta>
15 <refentrytitle>amrecover</refentrytitle>
16 <manvolnum>8</manvolnum>
17 &rmi.source;
18 &rmi.version;
19 &rmi.manual.8;
20 </refmeta>
21 <refnamediv>
22 <refname>amrecover</refname>
23 <refpurpose>Amanda index database browser</refpurpose>
24 </refnamediv>
25 <refentryinfo>
26 &author.alan;
27 &author.sgw.xml;
28 </refentryinfo>
29 <!-- body begins here -->
30 <refsynopsisdiv>
31 <cmdsynopsis>
32   <command>amrecover</command>    
33     <arg choice='opt'>-s <replaceable>index-server</replaceable></arg>
34     <arg choice='opt'>-t <replaceable>tape-server</replaceable></arg>
35     <arg choice='opt'>-d <replaceable>tape-device</replaceable></arg>
36     <arg choice='opt'>-h <replaceable>hostname</replaceable></arg>
37     &configoverride.synopsis;
38     <arg choice='opt'>-C <replaceable>config</replaceable></arg>
39 </cmdsynopsis>
40 </refsynopsisdiv>
41
42
43 <refsect1><title>DESCRIPTION</title>
44 <para><emphasis remap='B'>Amrecover</emphasis>
45 browses the database of Amanda index files to determine which tapes
46 contain files to recover.  Furthermore, it is able to recover files.</para>
47
48 <para>In order to restore files in place, you must invoke
49 <command>amrecover</command>
50 from the root of the backed up filesystem, or use
51 <emphasis remap='B'>lcd</emphasis>
52 to move into that directory, otherwise a directory tree that resembles 
53 the backed up filesystem will be created in the current directory.
54 See the examples below for details.</para>
55
56 <para>Amrecover will read the <emphasis remap='B'>amanda-client.conf</emphasis> file and the <replaceable>config</replaceable><emphasis remap='B'>/amanda-client.conf</emphasis> file.  If no configuration name is supplied on the command line, Amrecover will try the compiled-in default configuration ,usually <emphasis remap='B'>DailySet1</emphasis>.</para>
57
58 <para>See the
59 <manref name="amanda" vol="8"/>
60 man page for more details about Amanda.</para>
61 </refsect1>
62
63 <refsect1><title>OPTIONS</title>
64 <note><para>The Default values are those set at compile-time.
65 Use <command>amrestore</command> to recover client-encrypted or
66 client-custom-compressed tapes.</para>
67 </note>
68 <variablelist remap='TP'>
69   <varlistentry>
70   <term><emphasis remap='B'>[ -C ] config</emphasis></term>
71   <listitem>
72 <para>Amanda configuration.</para>
73   </listitem>
74   </varlistentry>
75   <varlistentry>
76   <term><option>-s index-server</option></term>
77   <listitem>
78 <para>Host that runs the index daemon.</para>
79   </listitem>
80   </varlistentry>
81   <varlistentry>
82   <term><option>-t tape-server</option></term>
83   <listitem>
84 <para>Host that runs the tape server daemon.</para>
85   </listitem>
86   </varlistentry>
87   <varlistentry>
88   <term><option>-d tape-device</option></term>
89   <listitem>
90 <para>Tape device to use on the tape server host.</para>
91   </listitem>
92   </varlistentry>
93   <varlistentry>
94   <term><option>-h hostname</option></term>
95   <listitem>
96 <para>Hostname to begin restoring; defaults to the system's hostname.</para>
97   </listitem>
98   </varlistentry>
99
100   <varlistentry>
101   <term><emphasis remap='B'>-o</emphasis> <replaceable>clientconfigoption</replaceable></term>
102   <listitem>
103 <para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>"
104  section in <manref name="amanda" vol="8"/>.</para>
105   </listitem>
106   </varlistentry>
107
108 </variablelist>
109 </refsect1>
110
111 <refsect1><title>AUTH</title>
112 <para>The default <emphasis remap='B'>auth</emphasis> is 'BSDTCP', you can set
113 a different auth in the <emphasis remap='B'>amanda-client.conf</emphasis> file
114 or by specifying the '-oauth=bsd' command line argument.</para>
115 </refsect1>
116
117 <refsect1><title>COMMANDS</title>
118 <para><emphasis remap='B'>Amrecover</emphasis>
119 connects to the index server and then presents a command line prompt.
120 Usage is similar to an ftp client.
121 The GNU readline library is used to provide command line history and editing
122 if it was built in to
123 <command>amrecover</command>.</para>
124
125 <para>The purpose of browsing the database is to build up a
126 <emphasis remap='I'>restore list</emphasis>
127 of files to be extracted from the backup system.
128 The following commands are available:</para>
129 <variablelist remap='TP'>
130   <varlistentry>
131   <term><emphasis remap='B'>sethost hostname</emphasis></term>
132   <listitem>
133 <para>Specifies which host to look at backup files for (default: the local host).</para>
134   </listitem>
135   </varlistentry>
136   <varlistentry>
137   <term><emphasis remap='B'>setdate YYYY-MM-DD-HH-MM[-SS] | YYYY-MM-DD</emphasis></term>
138   <listitem>
139 <para>Set the restore time (default: now).
140 File listing commands only return information on
141 backup images for this day,
142 for the day before with the next lower dump level,
143 and so on,
144 until the most recent level 0 backup on or before
145 the specified date is encountered.</para>
146
147 <para>For example, if:</para>
148
149 <!-- .RS -->
150 <literallayout remap='.nf'>
151 1996-07-01 was a level 0 backup
152 1996-07-02 through 1996-07-05 were level 1 backups
153 1996-07-06 through 1997-07-08 were level 2 backups
154 </literallayout> <!-- .fi -->
155
156 <para>then the command <emphasis remap='B'>setdate 1997-07-08-00</emphasis>
157 would yield files from the following days:</para>
158
159 <!-- .RS -->
160 <literallayout remap='.nf'>
161 1997-07-08 (the latest level 2 backup)
162 1997-07-05 (the latest level 1 backup)
163 1997-07-01 (the latest level 0 backup)
164 </literallayout> <!-- .fi -->
165
166 <para>Only the most recent version of a file will be presented.</para>
167
168 <para>The following abbreviated date specifications are accepted:</para>
169 <!-- .RS -->
170 <variablelist remap='TP'>
171   <varlistentry>
172   <term><option>--MM-DD</option></term>
173   <listitem>
174 <para>dates in the current year</para>
175   </listitem>
176   </varlistentry>
177   <varlistentry>
178   <term><option>---DD</option></term>
179   <listitem>
180 <para>dates in the current month of the current year</para>
181   </listitem>
182   </varlistentry>
183 </variablelist>
184   </listitem>
185   </varlistentry>
186 </variablelist>
187 <!-- .RE -->
188 <variablelist remap='TP'>
189   <varlistentry>
190   <term><emphasis remap='B'>setdisk</emphasis> <emphasis remap='I'>diskname</emphasis> [<emphasis remap='I'>mountpoint</emphasis>]</term>
191   <listitem>
192 <para>Specifies which disk to consider
193 (default: the disk holding the working directory where
194 <command>amrecover</command>
195 is started).
196 It can only be set after the host is set with
197 <emphasis remap='B'>sethost</emphasis>.
198 <emphasis remap='I'>Diskname</emphasis>
199 is the device name specified in the
200 <emphasis remap='I'>amanda.conf</emphasis>
201 or &disklist;.
202 The disk must be local to the host.
203 If
204 <emphasis remap='I'>mountpoint</emphasis>
205 is not specified, all pathnames will be relative to the (unknown)
206 mount point instead of full pathnames.</para>
207   </listitem>
208   </varlistentry>
209   <varlistentry>
210   <term><emphasis remap='B'>listhost</emphasis> [<emphasis remap='I'>diskdevice</emphasis>]</term>
211   <listitem>
212 <para>List all
213 <emphasis remap='B'>host</emphasis></para>
214   </listitem>
215   </varlistentry>
216   <varlistentry>
217   <term><emphasis remap='B'>listdisk</emphasis> [<emphasis remap='I'>diskdevice</emphasis>]</term>
218   <listitem>
219 <para>List all
220 <emphasis remap='B'>diskname</emphasis></para>
221   </listitem>
222   </varlistentry>
223   <varlistentry>
224   <term><emphasis remap='B'>listproperty</emphasis></term>
225   <listitem>
226 <para>List all
227 <emphasis remap='B'>property</emphasis></para>
228   </listitem>
229   </varlistentry>
230   <varlistentry>
231   <term><emphasis remap='B'>setproperty</emphasis> [<emphasis remap='B'>append</emphasis>] [<emphasis remap='B'>priority</emphasis>] <emphasis remap='I'>name</emphasis> [<emphasis remap='I'>value</emphasis> ...]</term>
232   <listitem>
233 <para>Set the property <emphasis remap='I'>name</emphasis> to the value <emphasis remap='I'>value</emphasis>.
234 The <emphasis remap='B'>append</emphasis> keyword appends the <emphasis remap='I'>value</emphasis> to the values already set for this property.
235 Without <emphasis remap='I'>value</emphasis>, the property is unset.
236 The <emphasis remap='B'>priority</emphasis> keyword is unused, it is present for ease of copy/paste from application definition.</para>
237   </listitem>
238   </varlistentry>
239   <varlistentry>
240   <term><emphasis remap='B'>setdevice</emphasis> [[-h <emphasis remap='I'>tape-server</emphasis>] <emphasis remap='I'>tapedev</emphasis>]</term>
241   <listitem>
242 <para>Specifies the host to use as the tape server, and which of its tape devices to use.
243 If the server is omitted, the server name reverts to the configure-time default.
244 If the tape device is omitted, the default is used.</para>
245
246 <para>If you want amrecover to use your changer, the 
247 <emphasis remap='I'>tapedev</emphasis>
248 must be equal to the <amkeyword>amrecover-changer</amkeyword> setting on the server.</para>
249
250 <para>Since device names contain colons, you must always specify the hostname.</para>
251
252 <programlisting>
253 settape 192.168.0.10:file:/file1
254 </programlisting>
255 <para>You can change the tape device when amrecover ask you to load the tape:</para>
256
257 <programlisting>
258 Load tape DMP014 now
259 Continue? [Y/n/t]: t
260 Tape device: server2:/dev/nst2
261 Continue? [Y/n/t]: Y
262 Using tape /dev/nst2 from server server2.
263 </programlisting>
264
265   </listitem>
266   </varlistentry>
267 </variablelist>
268
269 <variablelist remap='TP'>
270   <varlistentry>
271   <term><emphasis remap='B'>setmode</emphasis> <emphasis remap='I'>mode</emphasis></term>
272   <listitem>
273 <para>Set the extraction mode for Samba shares.
274 If
275 <emphasis remap='I'>mode</emphasis>
276 is
277 <emphasis remap='B'>smb</emphasis>,
278 shares are sent to the Samba server
279 to be restored back onto the PC.
280 If
281 <emphasis remap='I'>mode</emphasis>
282 is
283 <emphasis remap='B'>tar</emphasis>,
284 they are extracted on the local machine the same way tar volumes are extracted.</para>
285   </listitem>
286   </varlistentry>
287   <varlistentry>
288   <term><emphasis remap='B'>settranslate</emphasis> [<emphasis remap='B'>on</emphasis>|<emphasis remap='B'>off</emphasis>]</term>
289   <listitem>
290 <para>Default: on. Translate escaped octal value ('\000') in
291 the index file to their corespondig characters, it improve the interface
292 if amrecover is run in the same charset as the filename. Set it to
293 <emphasis remap='B'>off</emphasis> if the charset of some filename is not compatible with the amrecover charset.</para>
294   </listitem>
295   </varlistentry>
296   <varlistentry>
297   <term><emphasis remap='B'>mode</emphasis></term>
298   <listitem>
299 <para>Displays the extracting mode for Samba shares.</para>
300   </listitem>
301   </varlistentry>
302   <varlistentry>
303   <term><emphasis remap='B'>history</emphasis></term>
304   <listitem>
305 <para>Show the backup history of the current host and disk.
306 Dates, levels, tapes and file position on tape of each backup are displayed.</para>
307   </listitem>
308   </varlistentry>
309   <varlistentry>
310   <term><emphasis remap='B'>pwd</emphasis></term>
311   <listitem>
312 <para>Display the name of the current backup working directory.</para>
313   </listitem>
314   </varlistentry>
315   <varlistentry>
316   <term><emphasis remap='B'>cd</emphasis> <emphasis remap='I'>dir</emphasis></term>
317   <listitem>
318 <para>Change the backup working directory to
319 <emphasis remap='I'>dir.</emphasis>
320 If the mount point was specified with
321 <emphasis remap='B'>setdisk</emphasis>,
322 this can be a full pathname or it can be
323 relative to the current backup working directory.
324 If the mount point was not specified,
325 paths are relative to the mount point if they start with &quot;/&quot;,
326 otherwise they are relative to the current backup working directory.
327 The
328 <emphasis remap='I'>dir</emphasis>
329 can be a shell style wildcards.</para>
330   </listitem>
331   </varlistentry>
332   <varlistentry>
333   <term><emphasis remap='B'>cdx</emphasis> <emphasis remap='I'>dir</emphasis></term>
334   <listitem>
335 <para>Like the
336 <emphasis remap='B'>cd</emphasis>
337 command but allow regular expression.</para>
338   </listitem>
339   </varlistentry>
340   <varlistentry>
341   <term><emphasis remap='B'>lpwd</emphasis></term>
342   <listitem>
343 <para>Display the
344 <command>amrecover</command>
345 working directory.
346 Files will be restored under this directory,
347 relative to the backed up filesystem.</para>
348   </listitem>
349   </varlistentry>
350   <varlistentry>
351   <term><emphasis remap='B'>lcd</emphasis> <emphasis remap='I'>path</emphasis></term>
352   <listitem>
353 <para>Change the
354 <command>amrecover</command>
355 working directory to
356 <emphasis remap='I'>path</emphasis>.</para>
357   </listitem>
358   </varlistentry>
359   <varlistentry>
360   <term><emphasis remap='B'>ls</emphasis></term>
361   <listitem>
362 <para>List the contents of the current backup working directory.
363 See the description of the
364 <emphasis remap='B'>setdate</emphasis>
365 command for how the view of the
366 directory is built up.
367 The backup date is shown for each file.</para>
368   </listitem>
369   </varlistentry>
370   <varlistentry>
371   <term><emphasis remap='B'>add</emphasis> <emphasis remap='I'>item1 item2 ...</emphasis></term>
372   <listitem>
373 <para>Add the specified files or directories to the restore list.
374 Each item may have shell style wildcards.</para>
375   </listitem>
376   </varlistentry>
377   <varlistentry>
378   <term><emphasis remap='B'>addx</emphasis> <emphasis remap='I'>item1 item2 ...</emphasis></term>
379   <listitem>
380 <para>Add the specified files or directories to the restore list.
381 Each item may be a regular expression.</para>
382   </listitem>
383   </varlistentry>
384   <varlistentry>
385   <term><emphasis remap='B'>delete</emphasis> <emphasis remap='I'>item1 item2 ...</emphasis></term>
386   <listitem>
387 <para>Delete the specified files or directories from the restore list.
388 Each item may have shell style wildcards.</para>
389   </listitem>
390   </varlistentry>
391   <varlistentry>
392   <term><emphasis remap='B'>deletex</emphasis> <emphasis remap='I'>item1 item2 ...</emphasis></term>
393   <listitem>
394 <para>Delete the specified files or directories from the restore list.
395 Each item may be a regular expression.</para>
396   </listitem>
397   </varlistentry>
398   <varlistentry>
399   <term><emphasis remap='B'>list</emphasis> <emphasis remap='I'>file</emphasis></term>
400   <listitem>
401 <para>Display the contents of the restore list.
402 If a file name is specified,
403 the restore list is written to that file.
404 This can be used to manually extract the files from the Amanda tapes with
405 <emphasis remap='B'>amrestore</emphasis>.</para>
406   </listitem>
407   </varlistentry>
408   <varlistentry>
409   <term><emphasis remap='B'>clear</emphasis></term>
410   <listitem>
411 <para>Clear the restore list.</para>
412   </listitem>
413   </varlistentry>
414   <varlistentry>
415   <term><emphasis remap='B'>quit</emphasis></term>
416   <listitem>
417 <para>Close the connection to the index server and exit.</para>
418   </listitem>
419   </varlistentry>
420   <varlistentry>
421   <term><emphasis remap='B'>exit</emphasis></term>
422   <listitem>
423 <para>Close the connection to the index server and exit.</para>
424   </listitem>
425   </varlistentry>
426   <varlistentry>
427   <term><emphasis remap='B'>extract</emphasis></term>
428   <listitem>
429 <para>Start the extract sequence (see the examples below).  Make sure the
430 local working directory is the root of the backed up filesystem, or
431 another directory that will behave like that.  Use
432 <emphasis remap='B'>lpwd</emphasis>
433 to display the local working directory, and
434 <emphasis remap='B'>lcd</emphasis>
435 to change it.</para>
436   </listitem>
437   </varlistentry>
438   <varlistentry>
439   <term><emphasis remap='B'>help</emphasis></term>
440   <listitem>
441 <para>Display a brief list of these commands.</para>
442   </listitem>
443   </varlistentry>
444 </variablelist>
445 </refsect1>
446
447 <refsect1><title>EXAMPLES</title>
448 <para>The following shows the recovery of an old
449 <emphasis remap='I'>syslog</emphasis>
450 file.</para>
451
452 <programlisting>
453 # cd /var/log
454 # ls -l syslog.7
455 syslog.7: No such file or directory
456 # amrecover MyConfig
457 AMRECOVER Version 2.4.2. Contacting server on oops ...
458 220 oops Amanda index server (2.4.2) ready.
459 Setting restore date to today (1997-12-09)
460 200 Working date set to 1997-12-09.
461 200 Config set to MyConfig.
462 200 Dump host set to this-host.some.org.
463 $CWD '/var/log' is on disk '/var' mounted at '/var'.
464 200 Disk set to /var.
465 /var/log
466 WARNING: not on root of selected filesystem, check man-page!
467 amrecover&gt; ls
468 1997-12-09 daemon.log
469 1997-12-09 syslog
470 1997-12-08 authlog
471 1997-12-08 sysidconfig.log
472 1997-12-08 syslog.0
473 1997-12-08 syslog.1
474 1997-12-08 syslog.2
475 1997-12-08 syslog.3
476 1997-12-08 syslog.4
477 1997-12-08 syslog.5
478 1997-12-08 syslog.6
479 1997-12-08 syslog.7
480 amrecover&gt; add syslog.7
481 Added /log/syslog.7
482 amrecover&gt; lpwd
483 /var/log
484 amrecover&gt; lcd ..
485 /var
486 amrecover&gt; extract
487
488 Extracting files using tape drive /dev/nst0 on host 192.168.0.10
489
490 The following tapes are needed: DMP014
491
492 Restoring files into directory /var
493 Continue? [Y/n]: y
494
495 Load tape DMP014 now
496 Continue? [Y/n/t]: y
497 set owner/mode for '.'? [yn] n
498 amrecover&gt; quit
499 200 Good bye.
500 # ls -l syslog.7
501 total 26
502 -rw-r--r--   1 root     other      12678 Oct 14 16:36 syslog.7
503 </programlisting>
504
505 <para>If you do not want to overwrite existing files,
506 create a subdirectory to run
507 <command>amrecover</command>
508 from and then move the restored files afterward.</para>
509
510 <programlisting>
511 # cd /var
512 # (umask 077 ; mkdir .restore)
513 # cd .restore
514 # amrecover
515 AMRECOVER Version 2.4.2. Contacting server on oops ...
516 ...
517 amrecover&gt; cd log
518 /var/log
519 amrecover&gt; ls
520 ...
521 amrecover&gt; add syslog.7
522 Added /log/syslog.7
523 amrecover&gt; lpwd
524 /var/.restore
525 amrecover&gt; extract
526
527 Extracting files using tape drive /dev/nst0 on host 192.168.0.10
528 ...
529 amrecover&gt; quit
530 200 Good bye.
531 # mv -i log/syslog.7 ../log/syslog.7-restored
532 # cd ..
533 # rm -fr .restore
534 </programlisting>
535
536 <para>If you need to run
537 <emphasis remap='B'>amrestore</emphasis>
538 by hand instead of letting
539 <command>amrecover</command>
540 control it,
541 use the
542 <emphasis remap='B'>list</emphasis>
543 command after browsing to display the needed tapes.</para>
544
545 <programlisting>
546 # cd /var/log
547 # amrecover
548 AMRECOVER Version 2.4.2. Contacting server on oops ...
549 ...
550 amrecover&gt; ls
551 ...
552 amrecover&gt; add syslog syslog.6 syslog.7
553 Added /log/syslog
554 Added /log/syslog.6
555 Added /log/syslog.7
556 amrecover&gt; list
557 TAPE DMP014 LEVEL 0 DATE 1997-12-08
558         /log/syslog.7
559         /log/syslog.6
560 TAPE DMP015 LEVEL 1 DATE 1997-12-09
561         /log/syslog
562 amrecover&gt; quit 
563 </programlisting>
564
565 <para>The
566 <emphasis remap='B'>history</emphasis>
567 command shows each tape that has a backup of the
568 current disk along with the date of the backup,
569 the level,
570 the tape label
571 and the file position on the tape.
572 All active tapes are listed, not just back to
573 the most recent full dump.</para>
574
575 <para>Tape file position zero is a label.
576 The first backup image is in file position one.</para>
577
578 <programlisting>
579 # cd /var/log
580 # amrecover
581 AMRECOVER Version 2.4.2. Contacting server on oops ...
582 ...
583 amrecover&gt; history
584 200- Dump history for config &quot;MyConfig&quot; host &quot;this-host.some.org&quot; disk &quot;/var&quot;
585 201- 1997-12-09 1 DMP015 9
586 201- 1997-12-08 1 DMP014 11
587 201- 1997-12-07 0 DMP013 22
588 201- 1997-12-06 1 DMP012 16
589 201- 1997-12-05 1 DMP011 9
590 201- 1997-12-04 0 DMP010 11
591 201- 1997-12-03 1 DMP009 7
592 201- 1997-12-02 1 DMP008 7
593 201- 1997-12-01 1 DMP007 9
594 201- 1997-11-30 1 DMP006 6
595 ...
596 amrecover&gt; quit 
597 </programlisting>
598 </refsect1>
599
600 <refsect1><title>ENVIRONMENT</title>
601 <para><envar>PAGER</envar>
602 <!-- .RS -->
603 The 
604 <emphasis remap='B'>ls</emphasis>
605 and 
606 <emphasis remap='B'>list</emphasis>
607 commands will use $PAGER to display the file lists.
608 Defaults to
609 <emphasis remap='I'>more</emphasis>
610 if PAGER is not set.</para>
611 <para><envar>AMANDA_SERVER</envar>
612 If set, $AMANDA_SERVER will be used as index-server.
613 The value will take precedence over the compiled default,
614 but will be overridden by the -s switch.
615 </para>
616 <para><envar>AMANDA_TAPE_SERVER</envar>
617 If set, $AMANDA_TAPE_SERVER will be used as tape-server.
618 The value will take precedence over the compiled default,
619 but will be overridden by the -t switch.
620 </para>
621 <!-- .RE -->
622 </refsect1>
623
624 <seealso>
625 <manref name="amanda-client.conf" vol="5"/>
626 <manref name="amrestore" vol="8"/>
627 <manref name="amfetchdump" vol="8"/>
628 <manref name="readline" vol="3"/>
629 </seealso>
630
631 </refentry>