6.2. builddbm Previous topic Parent topic Child topic Next topic

builddbm is a testing tool that creates and updates DBM format user database files from flat file format user database files. For more information, see Section 9.3. DBM user database and Section 9.2. Flat file user database. It can also be used to print or delete the information for a single user from a DBM file.
DBM files should be used with Radiator if you require fast authentication, but also need to change your user database on the fly while Radiator is running, and you do not or cannot use <AuthBy SQL> or <AuthBy FILE> in Nocache mode.
Radiator will choose the best format of DBM file available to you, depending on which DBM modules are installed on your machine.
Tip
You can force it to choose a particular DBM file format by using the -t flag.
The arguments are:
builddbm [-z] [-u] [-f flatfile] [-d user] [-l user]
[-p]
[-t type] dbfile
  • -z
    This deletes all entries from the database before processing other commands.
  • -u
    This updates the mode and replaces user entries that already exist in the DBM file rather than showing an error.
  • -f flatfile
    The name of the flat file format user database to be used to populate the DBM file. The default value is dbfile, i.e. the name of the DBM file, without the .pag or .dir suffixes.
  • -d user
    This deletes the entry for user from the DBM file.
  • -l user
    This prints out the entry for user in a format that could be re-imported into builddbm.
  • -p
    This prints the contents of the DBM file in standard Livingston flat file format. The check and reply attributes of all users in the database are printed out in no particular order. The printed output goes to stdout.
  • -t dbmtype
    This forces builddbm to use a particular format of DBM file. The value of dbmtype can be AnyDBM_File, NDBM_File, DB_File, GDBM_File, SDBM_File or ODBM_File. Defaults to AnyDBM_File, which selects the best format on the host machine.
  • dbfile
    The base name of the DBM files to create or use. The actual filenames depend on the DBM module that Perl has selected, but, it is usually something like dbfile.dir and dbfile.pag. This is a mandatory parameter.

Example

Rebuild the entire DBM database in users.dir and users.pag from the users file, clearing old entries first:
builddbm -z users

Example

Update the Berkeley DB format database files all.db with the users in the file users:
builddbm -u -f users -t DB_File all.db

Example

Print the entry associated with the user mikem in the DBM files staff.dir, staff.pag:
builddbm -l mikem staff