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