Imported Upstream version 2.5.1p3
[debian/amanda] / docs / amrecover.8.txt
1
2                              amrecover
3 Prev  Chapter 36. The Amanda Manual Pages.  Next
4
5 -------------------------------------------------------------------------------
6
7 Name
8
9 amrecover \14 Amanda index database browser
10
11 Synopsis
12
13 amrecover [-C config] [-s index-server] [-t tape-server] [-d tape-device] [ -
14 o configoption]...
15
16 DESCRIPTION
17
18 Amrecover browses the database of Amanda index files to determine which tapes
19 contain files to recover. Furthermore, it is able to recover files.
20 In order to restore files in place, you must invoke amrecover from the root of
21 the backed up filesystem, or use lcd to move into that directory, otherwise a
22 directory tree that resembles the backed up filesystem will be created in the
23 current directory. See the examples below for details.
24 Amrecover will read the amanda-client.conf file and the config/amanda-
25 client.conf file.
26 See the amanda(8) man page for more details about Amanda.
27
28 OPTIONS
29
30
31 Note
32
33 The Default values are those set at compile-time. Use amrestore to recover
34 client-encrypted or client-custom-compressed tapes.
35
36
37   [ -C ] config
38       Amanda configuration.
39
40   -s index-server
41       Host that runs the index daemon.
42
43   -t tape-server
44       Host that runs the tape server daemon.
45
46   -d tape-device
47       Tape device to use on the tape server host.
48
49   -o clientconfigoption
50       See the "CONFIGURATION OVERWRITE" section in amanda(8).
51
52
53 COMMANDS
54
55 Amrecover connects to the index server and then presents a command line prompt.
56 Usage is similar to an ftp client. The GNU readline library is used to provide
57 command line history and editing if it was built in to amrecover.
58 The purpose of browsing the database is to build up a restore list of files to
59 be extracted from the backup system. The following commands are available:
60
61
62   sethost hostname
63       Specifies which host to look at backup files for (default: the local
64       host).
65
66   setdate YYYY-MM-DD-HH-MM[-SS] | YYYY-MM-DD
67       Set the restore time (default: now). File listing commands only return
68       information on backup images for this day, for the day before with the
69       next lower dump level, and so on, until the most recent level 0 backup on
70       or before the specified date is encountered.
71       For example, if:
72
73       1996-07-01 was a level 0 backup
74       1996-07-02 through 1996-07-05 were level 1 backups
75       1996-07-06 through 1997-07-08 were level 2 backups
76       then the command setdate 1997-07-08-00 would yield files from the
77       following days:
78
79       1997-07-08 (the latest level 2 backup)
80       1997-07-05 (the latest level 1 backup)
81       1997-07-01 (the latest level 0 backup)
82       Only the most recent version of a file will be presented.
83       The following abbreviated date specifications are accepted:
84
85
86         --MM-DD
87             dates in the current year
88
89         ---DD
90             dates in the current month of the current year
91
92
93
94
95   setdiskdiskname [mountpoint]
96       Specifies which disk to consider (default: the disk holding the working
97       directory where amrecover is started). It can only be set after the host
98       is set with sethost. Diskname is the device name specified in the
99       amanda.conf or disklist configuration file. The disk must be local to the
100       host. If mountpoint is not specified, all pathnames will be relative to
101       the (unknown) mount point instead of full pathnames.
102
103   listhost[diskdevice]
104       List all host
105
106   listdisk[diskdevice]
107       List all diskname
108
109   settape[[server]:][tapedev|default]
110       Specifies the host to use as the tape server, and which of its tape
111       devices to use. If the server is omitted, but the colon is not, the
112       server name reverts to the configure-time default. If the tape device is
113       omitted, it remains unchanged. To use the default tape device selected by
114       the tape server, the word default must be specified. If no argument is
115       specified, or the argument is an empty string, no changes occur, and the
116       current settings are displayed.
117       If you want amrecover to use your changer, the tapedev must be equal to
118       the amrecover_changer setting on the server.
119       If you need to change the protocol (tape:, rait:, file:, null:) then you
120       must specify the hostname.
121
122         settape 192.168.0.10:file:/file1
123
124       You can change the tape device when amrecover ask you to load the tape:
125
126         Load tape DMP014 now
127         Continue? [Y/n/t]: t
128         Tape device: server2:/dev/nst2
129         Continue? [Y/n/t]: Y
130         Using tape /dev/nst2 from server server2.
131
132
133
134
135   setmodemode
136       Set the extraction mode for Samba shares. If mode is smb, shares are sent
137       to the Samba server to be restored back onto the PC. If mode is tar, they
138       are extracted on the local machine the same way tar volumes are
139       extracted.
140
141   mode
142       Displays the extracting mode for Samba shares.
143
144   history
145       Show the backup history of the current host and disk. Dates, levels,
146       tapes and file position on tape of each backup are displayed.
147
148   pwd
149       Display the name of the current backup working directory.
150
151   cd dir
152       Change the backup working directory to dir. If the mount point was
153       specified with setdisk, this can be a full pathname or it can be relative
154       to the current backup working directory. If the mount point was not
155       specified, paths are relative to the mount point if they start with "/",
156       otherwise they are relative to the current backup working directory. The
157       dir can be a shell style wildcards.
158
159   cdxdir
160       Like the cd command but allow regular expression.
161
162   lpwd
163       Display the amrecover working directory. Files will be restored under
164       this directory, relative to the backed up filesystem.
165
166   lcdpath
167       Change the amrecover working directory to path.
168
169   ls
170       List the contents of the current backup working directory. See the
171       description of the setdate command for how the view of the directory is
172       built up. The backup date is shown for each file.
173
174   additem1 item2 ...
175       Add the specified files or directories to the restore list. Each item may
176       have shell style wildcards.
177
178   addxitem1 item2 ...
179       Add the specified files or directories to the restore list. Each item may
180       be a regular expression.
181
182   deleteitem1 item2 ...
183       Delete the specified files or directories from the restore list. Each
184       item may have shell style wildcards.
185
186   deletexitem1 item2 ...
187       Delete the specified files or directories from the restore list. Each
188       item may be a regular expression.
189
190   listfile
191       Display the contents of the restore list. If a file name is specified,
192       the restore list is written to that file. This can be used to manually
193       extract the files from the Amanda tapes with amrestore.
194
195   clear
196       Clear the restore list.
197
198   quit
199       Close the connection to the index server and exit.
200
201   exit
202       Close the connection to the index server and exit.
203
204   extract
205       Start the extract sequence (see the examples below). Make sure the local
206       working directory is the root of the backed up filesystem, or another
207       directory that will behave like that. Use lpwd to display the local
208       working directory, and lcd to change it.
209
210   help
211       Display a brief list of these commands.
212
213
214 EXAMPLES
215
216 The following shows the recovery of an old syslog file.
217
218   # cd /var/log
219   # ls -l syslog.7
220   syslog.7: No such file or directory
221   # amrecover
222   AMRECOVER Version 2.4.2. Contacting server on oops ...
223   220 oops Amanda index server (2.4.2) ready.
224   Setting restore date to today (1997-12-09)
225   200 Working date set to 1997-12-09.
226   200 Config set to daily.
227   200 Dump host set to this-host.some.org.
228   $CWD '/var/log' is on disk '/var' mounted at '/var'.
229   200 Disk set to /var.
230   /var/log
231   WARNING: not on root of selected filesystem, check man-page!
232   amrecover> ls
233   1997-12-09 daemon.log
234   1997-12-09 syslog
235   1997-12-08 authlog
236   1997-12-08 sysidconfig.log
237   1997-12-08 syslog.0
238   1997-12-08 syslog.1
239   1997-12-08 syslog.2
240   1997-12-08 syslog.3
241   1997-12-08 syslog.4
242   1997-12-08 syslog.5
243   1997-12-08 syslog.6
244   1997-12-08 syslog.7
245   amrecover> add syslog.7
246   Added /log/syslog.7
247   amrecover> lpwd
248   /var/log
249   amrecover> lcd ..
250   /var
251   amrecover> extract
252
253   Extracting files using tape drive /dev/nst0 on host 192.168.0.10
254
255   The following tapes are needed: DMP014
256
257   Restoring files into directory /var
258   Continue? [Y/n]: y
259
260   Load tape DMP014 now
261   Continue? [Y/n/t]: y
262   set owner/mode for '.'? [yn] n
263   amrecover> quit
264   200 Good bye.
265   # ls -l syslog.7
266   total 26
267   -rw-r--r--   1 root     other      12678 Oct 14 16:36 syslog.7
268
269 If you do not want to overwrite existing files, create a subdirectory to run
270 amrecover from and then move the restored files afterward.
271
272   # cd /var
273   # (umask 077 ; mkdir .restore)
274   # cd .restore
275   # amrecover
276   AMRECOVER Version 2.4.2. Contacting server on oops ...
277   ...
278   amrecover> cd log
279   /var/log
280   amrecover> ls
281   ...
282   amrecover> add syslog.7
283   Added /log/syslog.7
284   amrecover> lpwd
285   /var/.restore
286   amrecover> extract
287
288   Extracting files using tape drive /dev/nst0 on host 192.168.0.10
289   ...
290   amrecover> quit
291   200 Good bye.
292   # mv -i log/syslog.7 ../log/syslog.7-restored
293   # cd ..
294   # rm -fr .restore
295
296 If you need to run amrestore by hand instead of letting amrecover control it,
297 use the list command after browsing to display the needed tapes.
298
299   # cd /var/log
300   # amrecover
301   AMRECOVER Version 2.4.2. Contacting server on oops ...
302   ...
303   amrecover> ls
304   ...
305   amrecover> add syslog syslog.6 syslog.7
306   Added /log/syslog
307   Added /log/syslog.6
308   Added /log/syslog.7
309   amrecover> list
310   TAPE DMP014 LEVEL 0 DATE 1997-12-08
311           /log/syslog.7
312           /log/syslog.6
313   TAPE DMP015 LEVEL 1 DATE 1997-12-09
314           /log/syslog
315   amrecover> quit
316
317 The history command shows each tape that has a backup of the current disk along
318 with the date of the backup, the level, the tape label and the file position on
319 the tape. All active tapes are listed, not just back to the most recent full
320 dump.
321 Tape file position zero is a label. The first backup image is in file position
322 one.
323
324   # cd /var/log
325   # amrecover
326   AMRECOVER Version 2.4.2. Contacting server on oops ...
327   ...
328   amrecover> history
329   200- Dump history for config "daily" host "this-host.some.org" disk "/var"
330   201- 1997-12-09 1 DMP015 9
331   201- 1997-12-08 1 DMP014 11
332   201- 1997-12-07 0 DMP013 22
333   201- 1997-12-06 1 DMP012 16
334   201- 1997-12-05 1 DMP011 9
335   201- 1997-12-04 0 DMP010 11
336   201- 1997-12-03 1 DMP009 7
337   201- 1997-12-02 1 DMP008 7
338   201- 1997-12-01 1 DMP007 9
339   201- 1997-11-30 1 DMP006 6
340   ...
341   amrecover> quit
342
343
344 ENVIRONMENT
345
346 PAGER The ls and list commands will use $PAGER to display the file lists.
347 Defaults to more if PAGER is not set.
348 AMANDA_SERVER If set, $AMANDA_SERVER will be used as index-server. The value
349 will take precedence over the compiled default, but will be overridden by the -
350 s switch.
351 AMANDA_TAPE_SERVER If set, $AMANDA_TAPE_SERVER will be used as tape-server. The
352 value will take precedence over the compiled default, but will be overridden by
353 the -t switch.
354
355 AUTHOR
356
357 Alan M. McIvor <alan@kauri.auck.irl.cri.nz> : Original text
358 Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
359 XML-conversion
360
361 SEE ALSO
362
363 amanda(8), amanda-client.conf(5), amrestore(8), amfetchdump(8), readline(3)
364 -------------------------------------------------------------------------------
365
366 Prev     Up       Next
367 amplot  Home  amreport
368