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