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