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