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