d00fbca0e3da03aca5c49916a47ed7f7fab5be48
[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 OVERWRITE</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'>settape </emphasis>[[<emphasis remap='I'>server</emphasis>]:][<emphasis remap='I'>tapedev</emphasis>|<emphasis remap='I'>default</emphasis>]</term>
207   <listitem>
208 <para>Specifies the host to use as the tape server, and which of its tape
209 devices to use.
210 If the server is omitted, but the colon is not, the
211 server name reverts to the configure-time
212 default.
213 If the tape device is omitted, it remains unchanged.
214 To use the default tape device selected by the tape server, the word
215 <emphasis remap='I'>default</emphasis>
216 must be specified.
217 If no argument is specified, or the argument is an
218 empty string, no changes occur, and the current settings are
219 displayed.</para>
220
221 <para>If you want amrecover to use your changer, the 
222 <emphasis remap='I'>tapedev</emphasis>
223 must be equal to the amrecover_changer setting on the server.</para>
224
225 <para>If you need to change the protocol (tape:, rait:, file:, null:) then you
226 must specify the hostname.</para>
227
228 <programlisting>
229 settape 192.168.0.10:file:/file1
230 </programlisting>
231 <para>You can change the tape device when amrecover ask you to load the tape:</para>
232
233 <programlisting>
234 Load tape DMP014 now
235 Continue? [Y/n/t]: t
236 Tape device: server2:/dev/nst2
237 Continue? [Y/n/t]: Y
238 Using tape /dev/nst2 from server server2.
239 </programlisting>
240
241   </listitem>
242   </varlistentry>
243 </variablelist>
244
245 <variablelist remap='TP'>
246   <varlistentry>
247   <term><emphasis remap='B'>setmode </emphasis><emphasis remap='I'>mode</emphasis></term>
248   <listitem>
249 <para>Set the extraction mode for Samba shares.
250 If
251 <emphasis remap='I'>mode</emphasis>
252 is
253 <emphasis remap='B'>smb</emphasis>,
254 shares are sent to the Samba server
255 to be restored back onto the PC.
256 If
257 <emphasis remap='I'>mode</emphasis>
258 is
259 <emphasis remap='B'>tar</emphasis>,
260 they are extracted on the local machine the same way tar volumes are extracted.</para>
261   </listitem>
262   </varlistentry>
263   <varlistentry>
264   <term><emphasis remap='B'>mode</emphasis></term>
265   <listitem>
266 <para>Displays the extracting mode for Samba shares.</para>
267   </listitem>
268   </varlistentry>
269   <varlistentry>
270   <term><emphasis remap='B'>history</emphasis></term>
271   <listitem>
272 <para>Show the backup history of the current host and disk.
273 Dates, levels, tapes and file position on tape of each backup are displayed.</para>
274   </listitem>
275   </varlistentry>
276   <varlistentry>
277   <term><emphasis remap='B'>pwd</emphasis></term>
278   <listitem>
279 <para>Display the name of the current backup working directory.</para>
280   </listitem>
281   </varlistentry>
282   <varlistentry>
283   <term><emphasis remap='B'>cd dir</emphasis></term>
284   <listitem>
285 <para>Change the backup working directory to
286 <emphasis remap='I'>dir.</emphasis>
287 If the mount point was specified with
288 <emphasis remap='B'>setdisk</emphasis>,
289 this can be a full pathname or it can be
290 relative to the current backup working directory.
291 If the mount point was not specified,
292 paths are relative to the mount point if they start with &quot;/&quot;,
293 otherwise they are relative to the current backup working directory.
294 The
295 <emphasis remap='I'>dir</emphasis>
296 can be a shell style wildcards.</para>
297   </listitem>
298   </varlistentry>
299   <varlistentry>
300   <term><emphasis remap='B'>cdx </emphasis><emphasis remap='I'>dir</emphasis></term>
301   <listitem>
302 <para>Like the
303 <emphasis remap='B'>cd</emphasis>
304 command but allow regular expression.</para>
305   </listitem>
306   </varlistentry>
307   <varlistentry>
308   <term><emphasis remap='B'>lpwd</emphasis></term>
309   <listitem>
310 <para>Display the
311 <command>amrecover</command>
312 working directory.
313 Files will be restored under this directory,
314 relative to the backed up filesystem.</para>
315   </listitem>
316   </varlistentry>
317   <varlistentry>
318   <term><emphasis remap='B'>lcd </emphasis><emphasis remap='I'>path</emphasis></term>
319   <listitem>
320 <para>Change the
321 <command>amrecover</command>
322 working directory to
323 <emphasis remap='I'>path</emphasis>.</para>
324   </listitem>
325   </varlistentry>
326   <varlistentry>
327   <term><emphasis remap='B'>ls</emphasis></term>
328   <listitem>
329 <para>List the contents of the current backup working directory.
330 See the description of the
331 <emphasis remap='B'>setdate</emphasis>
332 command for how the view of the
333 directory is built up.
334 The backup date is shown for each file.</para>
335   </listitem>
336   </varlistentry>
337   <varlistentry>
338   <term><emphasis remap='B'>add </emphasis><emphasis remap='I'>item1 item2 ...</emphasis></term>
339   <listitem>
340 <para>Add the specified files or directories to the restore list.
341 Each item may have shell style wildcards.</para>
342   </listitem>
343   </varlistentry>
344   <varlistentry>
345   <term><emphasis remap='B'>addx </emphasis><emphasis remap='I'>item1 item2 ...</emphasis></term>
346   <listitem>
347 <para>Add the specified files or directories to the restore list.
348 Each item may be a regular expression.</para>
349   </listitem>
350   </varlistentry>
351   <varlistentry>
352   <term><emphasis remap='B'>delete </emphasis><emphasis remap='I'>item1 item2 ...</emphasis></term>
353   <listitem>
354 <para>Delete the specified files or directories from the restore list.
355 Each item may have shell style wildcards.</para>
356   </listitem>
357   </varlistentry>
358   <varlistentry>
359   <term><emphasis remap='B'>deletex </emphasis><emphasis remap='I'>item1 item2 ...</emphasis></term>
360   <listitem>
361 <para>Delete the specified files or directories from the restore list.
362 Each item may be a regular expression.</para>
363   </listitem>
364   </varlistentry>
365   <varlistentry>
366   <term><emphasis remap='B'>list </emphasis><emphasis remap='I'>file</emphasis></term>
367   <listitem>
368 <para>Display the contents of the restore list.
369 If a file name is specified,
370 the restore list is written to that file.
371 This can be used to manually extract the files from the &A; tapes with
372 <emphasis remap='B'>amrestore</emphasis>.</para>
373   </listitem>
374   </varlistentry>
375   <varlistentry>
376   <term><emphasis remap='B'>clear</emphasis></term>
377   <listitem>
378 <para>Clear the restore list.</para>
379   </listitem>
380   </varlistentry>
381   <varlistentry>
382   <term><emphasis remap='B'>quit</emphasis></term>
383   <listitem>
384 <para>Close the connection to the index server and exit.</para>
385   </listitem>
386   </varlistentry>
387   <varlistentry>
388   <term><emphasis remap='B'>exit</emphasis></term>
389   <listitem>
390 <para>Close the connection to the index server and exit.</para>
391   </listitem>
392   </varlistentry>
393   <varlistentry>
394   <term><emphasis remap='B'>extract</emphasis></term>
395   <listitem>
396 <para>Start the extract sequence (see the examples below).  Make sure the
397 local working directory is the root of the backed up filesystem, or
398 another directory that will behave like that.  Use
399 <emphasis remap='B'>lpwd</emphasis>
400 to display the local working directory, and
401 <emphasis remap='B'>lcd</emphasis>
402 to change it.</para>
403   </listitem>
404   </varlistentry>
405   <varlistentry>
406   <term><emphasis remap='B'>help</emphasis></term>
407   <listitem>
408 <para>Display a brief list of these commands.</para>
409   </listitem>
410   </varlistentry>
411 </variablelist>
412 </refsect1>
413
414 <refsect1><title>EXAMPLES</title>
415 <para>The following shows the recovery of an old
416 <emphasis remap='I'>syslog</emphasis>
417 file.</para>
418
419 <programlisting>
420 # cd /var/log
421 # ls -l syslog.7
422 syslog.7: No such file or directory
423 # amrecover
424 AMRECOVER Version 2.4.2. Contacting server on oops ...
425 220 oops &A; index server (2.4.2) ready.
426 Setting restore date to today (1997-12-09)
427 200 Working date set to 1997-12-09.
428 200 Config set to daily.
429 200 Dump host set to this-host.some.org.
430 $CWD '/var/log' is on disk '/var' mounted at '/var'.
431 200 Disk set to /var.
432 /var/log
433 WARNING: not on root of selected filesystem, check man-page!
434 amrecover&gt; ls
435 1997-12-09 daemon.log
436 1997-12-09 syslog
437 1997-12-08 authlog
438 1997-12-08 sysidconfig.log
439 1997-12-08 syslog.0
440 1997-12-08 syslog.1
441 1997-12-08 syslog.2
442 1997-12-08 syslog.3
443 1997-12-08 syslog.4
444 1997-12-08 syslog.5
445 1997-12-08 syslog.6
446 1997-12-08 syslog.7
447 amrecover&gt; add syslog.7
448 Added /log/syslog.7
449 amrecover&gt; lpwd
450 /var/log
451 amrecover&gt; lcd ..
452 /var
453 amrecover&gt; extract
454
455 Extracting files using tape drive /dev/nst0 on host 192.168.0.10
456
457 The following tapes are needed: DMP014
458
459 Restoring files into directory /var
460 Continue? [Y/n]: y
461
462 Load tape DMP014 now
463 Continue? [Y/n/t]: y
464 set owner/mode for '.'? [yn] n
465 amrecover&gt; quit
466 200 Good bye.
467 # ls -l syslog.7
468 total 26
469 -rw-r--r--   1 root     other      12678 Oct 14 16:36 syslog.7
470 </programlisting>
471
472 <para>If you do not want to overwrite existing files,
473 create a subdirectory to run
474 <command>amrecover</command>
475 from and then move the restored files afterward.</para>
476
477 <programlisting>
478 # cd /var
479 # (umask 077 ; mkdir .restore)
480 # cd .restore
481 # amrecover
482 AMRECOVER Version 2.4.2. Contacting server on oops ...
483 ...
484 amrecover&gt; cd log
485 /var/log
486 amrecover&gt; ls
487 ...
488 amrecover&gt; add syslog.7
489 Added /log/syslog.7
490 amrecover&gt; lpwd
491 /var/.restore
492 amrecover&gt; extract
493
494 Extracting files using tape drive /dev/nst0 on host 192.168.0.10
495 ...
496 amrecover&gt; quit
497 200 Good bye.
498 # mv -i log/syslog.7 ../log/syslog.7-restored
499 # cd ..
500 # rm -fr .restore
501 </programlisting>
502
503 <para>If you need to run
504 <emphasis remap='B'>amrestore</emphasis>
505 by hand instead of letting
506 <command>amrecover</command>
507 control it,
508 use the
509 <emphasis remap='B'>list</emphasis>
510 command after browsing to display the needed tapes.</para>
511
512 <programlisting>
513 # cd /var/log
514 # amrecover
515 AMRECOVER Version 2.4.2. Contacting server on oops ...
516 ...
517 amrecover&gt; ls
518 ...
519 amrecover&gt; add syslog syslog.6 syslog.7
520 Added /log/syslog
521 Added /log/syslog.6
522 Added /log/syslog.7
523 amrecover&gt; list
524 TAPE DMP014 LEVEL 0 DATE 1997-12-08
525         /log/syslog.7
526         /log/syslog.6
527 TAPE DMP015 LEVEL 1 DATE 1997-12-09
528         /log/syslog
529 amrecover&gt; quit 
530 </programlisting>
531
532 <para>The
533 <emphasis remap='B'>history</emphasis>
534 command shows each tape that has a backup of the
535 current disk along with the date of the backup,
536 the level,
537 the tape label
538 and the file position on the tape.
539 All active tapes are listed, not just back to
540 the most recent full dump.</para>
541
542 <para>Tape file position zero is a label.
543 The first backup image is in file position one.</para>
544
545 <programlisting>
546 # cd /var/log
547 # amrecover
548 AMRECOVER Version 2.4.2. Contacting server on oops ...
549 ...
550 amrecover&gt; history
551 200- Dump history for config &quot;daily&quot; host &quot;this-host.some.org&quot; disk &quot;/var&quot;
552 201- 1997-12-09 1 DMP015 9
553 201- 1997-12-08 1 DMP014 11
554 201- 1997-12-07 0 DMP013 22
555 201- 1997-12-06 1 DMP012 16
556 201- 1997-12-05 1 DMP011 9
557 201- 1997-12-04 0 DMP010 11
558 201- 1997-12-03 1 DMP009 7
559 201- 1997-12-02 1 DMP008 7
560 201- 1997-12-01 1 DMP007 9
561 201- 1997-11-30 1 DMP006 6
562 ...
563 amrecover&gt; quit 
564 </programlisting>
565 </refsect1>
566
567 <refsect1><title>ENVIRONMENT</title>
568 <para><envar>PAGER</envar>
569 <!-- .RS -->
570 The 
571 <emphasis remap='B'>ls</emphasis>
572 and 
573 <emphasis remap='B'>list</emphasis>
574 commands will use $PAGER to display the file lists.
575 Defaults to
576 <emphasis remap='I'>more</emphasis>
577 if PAGER is not set.</para>
578 <para><envar>AMANDA_SERVER</envar>
579 If set, $AMANDA_SERVER will be used as index-server.
580 The value will take precedence over the compiled default,
581 but will be overridden by the -s switch.
582 </para>
583 <para><envar>AMANDA_TAPE_SERVER</envar>
584 If set, $AMANDA_TAPE_SERVER will be used as tape-server.
585 The value will take precedence over the compiled default,
586 but will be overridden by the -t switch.
587 </para>
588 <!-- .RE -->
589 </refsect1>
590
591 <refsect1><title>AUTHOR</title>
592 <para>Alan M. McIvor <email>alan@kauri.auck.irl.cri.nz</email> : Original text</para>
593 <para>&maintainer.sgw;: XML-conversion</para>
594 </refsect1>
595
596 <refsect1><title>SEE ALSO</title>
597 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
598 <citerefentry><refentrytitle>amanda-client.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
599 <citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
600 <citerefentry><refentrytitle>amfetchdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
601 <citerefentry><refentrytitle>readline</refentrytitle><manvolnum>3</manvolnum></citerefentry></para>
602 </refsect1>
603 </refentry>
604