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