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