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