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