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