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