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