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