Imported Upstream version 2.5.1p3
[debian/amanda] / docs / indexing.txt
1
2 Chapter 4. Indexing with Amanda
3 Prev  Part I. Installation  Next
4
5 -------------------------------------------------------------------------------
6
7 Chapter 4. Indexing with Amanda
8
9
10 Alan M. McIvor
11
12 Original text
13
14 Stefan G. Weichinger
15
16 XML-conversion;Updates
17 AMANDA Core Team
18 <sgw@amanda.org>
19 Table of Contents
20
21
22   Database_Format
23
24   Database_Browsing
25
26   File_Extraction
27
28   Protocol_Between_amindexd_and_amrecover
29
30   Installation_Notes
31
32   Permissions
33
34   Changes_from_amindex-1.0
35
36   Changes_from_amindex-0.3
37
38   Changes_from_amindex-0.2
39
40   Changes_from_amindex-0.1
41
42   Changes/additions_to_2.3.0
43
44   Known_Bugs
45
46
47 Note
48
49 Refer to http://www.amanda.org/docs/indexing.html for the current version of
50 this document.
51 This file describes how the index files are generated and how amrecover is
52 used.
53
54  Database Format
55
56 The database consists of a directory tree of the format: $host/$disk/
57 $date_$level.gz
58 The host and disk are those listed in the disklist file, the "$host/$disk/" is
59 like the curinfo database, '/' are changed for '_'. There is an index file for
60 each dump, the name of the file is made of the date and the level, they will
61 have the .gz suffix if they are compressed with gzip.
62 ex. The file foo/_usr/19991231_0.gz is the index of the level 0 made on
63 19991231 of the disk /usr of the host foo.
64 The files are ASCII text files containing a list of the directory and files of
65 the dump, one per line. Each entry is the filename relative to the mount point,
66 starting with a /, e.g., /home/user1/data from the disk mounted on /home would
67 generate the entry /user1/data. The index files are stored in compressed format
68 (eg gzip or compress).
69
70  Database Browsing
71
72 The client is called amrecover and is loosely based on the functionality of the
73 program recover from Backup Copilot. A user starts up amrecover. This requires
74 specifying the index server and the Amanda config name (defaults for both are
75 compiled in as part of the installation). Then the user has to specify the name
76 of the host information is wanted about, the disk name, and (optionally) the
77 disk mount point. Finally a date needs to be specified. Given all this, the
78 user can then roam around a virtual file system using ls and cd much like in a
79 FTP client. The file system contains all files backed up on the specified date,
80 or before that date, back to the last level 0 backup. Only the most recent
81 version of any file is shown.
82 As the file system is traversed, the user can add and delete files to a
83 "shopping list", and print the list out.
84
85  File Extraction
86
87 When a user has built up a list of files to extract, they can be extracted by
88 issuing the command extract within amrecover.
89 Files are extracted by the following, for each different tape needed.
90 As part of the installation, a "tape server" daemon amidxtaped is installed on
91 one or more designated hosts, which have an attached tape drive. This is used
92 to read the tapes. See the config files for the options for specifying a
93 default.
94 amrecover contacts amidxtaped on the tape server host specifying which tape
95 device to use, which host and disk files are needed for. On the tape server
96 host, amidxtaped executes amrestore to get the dump image file off the tape,
97 and returns the data to amrecover.
98 If dumps are stored compressed for the client, then amrecover pipes the data
99 through the appropriate uncompression routine to uncompress it before piping it
100 into restore, which then extracts the required files from the dump image.
101 Note that a user can only extract files from a host running the same operating
102 system as he/she is executing amrecover on, since the native dump/restore tools
103 are used - unless GNU-tar is used.
104
105  Protocol Between amindexd and amrecover
106
107 The protocol talked between amindexd and amrecover is a simple ASCII chat
108 protocol based on that used in FTP. amrecover sends a 1 line command, and
109 amindexd replies with a 1 line or multi-line reply. Each line of the reply
110 starts with a three digit code, starting with a '5' if an error occurred. For 1
111 line replies, and the last line of a multi-line reply, the 4th character is a
112 space. For all but the last line of a multi-line reply, the 4th character is a
113 '-'.
114 The commands and replies other than acknowledgments are:
115 Table 4.1. Protocol between amindexd and amrecover
116  ____________________________________________________________________________
117 |QUIT_______________|finish_up_and_close_connection__________________________|
118 |HOST_<host>________|set_host_to_host________________________________________|
119 |DISK_<disk>________|set_disk_to_disk________________________________________|
120 |LISTDISK_[<device>]|list_the_disks_for_the_current_host_____________________|
121 |SCNF_<config>______|set_Amanda_configuration_to_config______________________|
122 |DATE_<date>________|set_date_to_date________________________________________|
123 |DHST_______________|return_dump_history_of_current_disk_____________________|
124 |                   |Opaque is directory? query. Is the directory dir present|
125 |OISD <dir>         |in the backups of the current disk back to and including|
126 |___________________|the_last_level_0_dump.__________________________________|
127 |                   |Opaque list directory. Give all filenames present in dir|
128 |OLSD <dir>         |in the backups of the current disk back to and including|
129 |___________________|the_last_level_0_dump.__________________________________|
130 |                   |Opaque recursive list directory. Give all filenames     |
131 |ORLD <dir>         |present in dir and subdir in the backups of the current |
132 |___________________|disk_back_to_and_including_the_last_level_0_dump._______|
133 |TAPE_______________|return_value_of_tapedev_from_amanda.conf_if_set.________|
134 |DCMP               |returns "YES" if dumps for disk are compressed, "NO" if |
135 |___________________|dumps_aren't.___________________________________________|
136
137
138
139  Installation Notes
140
141
142   1. Whether or not an index is created for a disk is controlled by a disk
143      configuration option index. So, in amanda.conf you need to define a
144      disktype with this option, e.g.,
145
146        define dumptype comp-user-index {
147        comment "Non-root partitions on reasonably fast machines"
148        compress client fast
149        index yes
150        priority medium
151        }
152
153   2. You need to define disks that you want to generate an index for to
154      be of one of the disktypes you defined which contain the index option.
155      This cause sendbackup-dump on the client machine to generate an index file
156      which is stored local to the client, for later recovery by amgetidx (which
157      is called by amdump).
158   3. Amanda saves all the index files under a directory specified by
159      "indexdir" in amanda.conf. You need to create this directory by hand. It
160      needs to have read/write permissions set for the user you defined to run
161      Amanda.
162      If you are using the "text database" option you may set indexdir and
163      infofile to be the same directory.
164   4. The index browser, amrecover, currently gets installed as part of the
165      client software. Its location may not be appropriate for your system and
166      you may need to move it to a more accessible place such as /usr/local/bin.
167      See its man page for how to use it.
168      Note that amindexd, amgetidx, amidxtaped, and amtrmidx all write debug
169      files on the server in /tmp (unless this feature is disabled in the source
170      code), which are useful for diagnosing problems. amrecover writes a debug
171      file in /tmp on the machine it is invoked.
172
173
174  Permissions
175
176 The userid chosen to run the Amanda client code must have permission to run
177 restore since this is used by createindex-dump to generate the index files.
178 For a user to be able to restore files from within amrecover, that user must
179 have permission to run restore.
180
181  Changes from amindex-1.0
182
183 Get index directory from amanda.conf.
184 Integration into Amanda-2.3.0.4.
185 Rewriting of amgetidx to use amandad instead of using rsh/rcp.
186
187  Changes from amindex-0.3
188
189 Support for index generation using GNU-tar.
190 Support for restoring files from within amrecover.
191 Bug fixes:
192
193 * index/client/amrecover.c (guess_disk): Removed inclusion of mntent.h and use
194   of MAXMNTSTR since this was non-portable, as pointed out by Izzy Ergas
195   <erga00@nbhd.org>.
196
197
198 * index/client/display_commands.c (list_directory): Removed point where
199   list_directory() could sleep for ever waiting for input that wasn't going to
200   come.
201
202
203 * index/server/amindexd.c index/client/uscan.l Installed patches from Les
204   Gondor <les@trigraph.on.ca> to make amrecover handle spaces in file names.
205
206
207 * server-src/amcontrol.sh: As pointed out by Neal Becker <neal@ctd.comsat.com>
208   there were still a few sh-style comments that needed conversion to c-style.
209
210
211  Changes from amindex-0.2
212
213
214 * index/client/Makefile.in
215 * index/client/help.c
216 * index/client/amrecover.h
217 * index/client/uparse.y
218 * index/client/uscan.l Added a help command.
219
220
221 * index/client/set_commands.c: set_disk() and set_host() now check for empty
222   extract list.
223
224
225 * index/client/extract_list.c:
226 * index/client/amrecover.h:
227 * index/client/uparse.y:
228 * index/client/uscan.l: Added clear extract list command.
229
230
231 * index/client/set_commands.c (set_disk): Added code so working directory set
232   to mount point.
233
234
235 * index/client/extract_list.c: If the last item on a tape list is deleted, the
236   tape list itself is now deleted from the extract list.
237
238
239 * index/client/amrecover.c:
240 * index/server/amindex.c: If the server started up and found that the index dir
241   doesn't exist, then it exited immediately and the client got informative
242   message. Corrected this so it is obvious what is wrong to the user, since
243   this is most likely to occur when somebody is setting up for the first time
244   and needs all the help they can get.
245
246
247 * server-src/amgetidx.c Added patch from Pete Geenhuizen
248   <pete@gasbuggy.rockledge.fl.us> so that it works even when remote shell is
249   csh.
250
251
252 * server-src/amcontrol.sh
253 * server-src/Makefile.in Amcontrol is now parameterized like other scripts and
254   run through munge to generate installable version.
255
256
257 * index/server/amindexd.c (main): Added code to set userid if FORCE_USERID set.
258
259
260 * index/server/amindexd.c Removed #define for full path of grep. Assumed now to
261   be on path.
262
263
264 * client-src/createindex-dump.c
265 * client-src/sendbackup-dump.c
266 * man/Makefile.in Added patch from Philippe Charnier <charnier@lirmm.fr> so
267   they work when things are installed with version numbers. This was also
268   reported by Neal Becker <neal@ctd.comsat.com>. Also patch to set installed
269   man page modes and create directory if needed.
270
271
272 * config/options.h-sunos4 Corrected definition for flex library.
273
274
275 * server-src/amtrmidx.c Added some pclose() commands, used remove() instead of
276   system("rm .."). Problems reported by Pete Geenhuizen
277   (<pete@gasbuggy.rockledge.fl.us>) on a system with small ulimits set.
278
279
280 * index/server/amindexd.[ch]
281 * index/server/list_dir.c
282 * index/client/amrecover.c
283 * index/client/set_commands.c
284 * index/client/uparse.y Changes developed with the help of Pete Geenhuizen
285   <pete@gasbuggy.rockledge.fl.us> to support disks specified by logical names.
286   Also, now debug files generated by amrecover include PID so multiple users
287   can use amrecover simultaneously and without file deletion permission
288   problems.
289
290
291 * config/config.h-hpux:
292 * config/config-common.h:
293 * server-src/amgetidx.c: Changes from Neal Becker re remote shell, making it a
294   configuration parameter.
295
296
297 * config/options.h-sunos4 Had -Lfl instead of -lfl
298
299
300  Changes from amindex-0.1
301
302
303 * index/client/uscan.l: added support for abbreviated date specs
304
305
306 * index/client/amrecover.c (guess_disk): guess_disk got disk_path wrong if
307   mount point other than / (as subsequently pointed out by Eir Doutreleau
308   <ed@cti.ecp.fr>)
309
310
311 * server-src/amtrmidx: Added amtrmidx which removes old index files.
312
313
314 * index/client: Added a pwd command
315
316
317 * server-src/amgetidx.c (main): Added use of CLIENT_LOGIN username on r
318   commands. (as pointed out by Eric Payan <Eric.Payan@ufrima.imag.fr>)
319
320
321 * server-src/amgetidx.c: Bug: It was copying from all clients irrespective of
322   whether the client was configured for indices. A '}' in the wrong place.
323
324
325 * server-src/amgetidx.c: Removed user configuration section. Instead include
326   amindexd.h to get information.
327
328
329  Changes/additions to 2.3.0
330
331 common-src/conffile.[ch]
332
333 * added "index" as a valid option
334
335 server-src/driverio.c
336
337 * added code to optionstr() to write "index" into option string
338
339 client-src/sendback-dump.c
340
341 * added code to generate index if requested.
342
343 client-src/indexfilename.[ch] client-src/createindex-dump.c
344
345 * code to generate index.
346
347 client-src/Makefile.in
348
349 * a new target. Another file for sendbackup-dump
350
351 config/config-common.h
352
353 * added def of restore.
354
355
356  Known Bugs
357
358
359 * Empty directories don't get into the listing for a dump (at all dump levels).
360
361
362 * When amrecover starts up, it tries to guess the disk and mount point from the
363   current directory of the working system. This doesn't work for disks
364   specified by logical names, nor when an automounter is being used, or a link
365   is in the path.
366
367 -------------------------------------------------------------------------------
368
369 Prev                   Up                                     Next
370 Chapter 3. Excluding  Home  Chapter 5. Backup PC hosts using Samba
371