Next: , Previous: , Up: Top   [Contents][Index]


26 The gdbm_load utility

The gdbm_load utility restores a GDBM database from a flat file. The utility requires at least one argument: the name of the input flat file. If it is ‘-’, the standard input will be read. The format of the input file is detected automatically.

By default the utility attempts to restore the database under its original name, as stored in the input file. It will fail to do so if the input is in binary format. In that case, the name of the database must be given as the second argument.

In general, if two arguments are given, the second one is treated as the name of the database to create, overriding the file name specified in the flat file. All existing keys will be removed from this database prior to loading from the dump. Use the --update (-U) option if it is not what you wish.

When given the --update (-U) option, gdbm_load will update the existing database with the data from the dump. It will bail out if the dump contains a key that is already present in the database. To silently overwrite existing keys, use the --replace (-r) option.

The utility understands the following command line options:

-b num
--block-size=num

Sets block size. See block_size.

-c num
--cache-size=num

Sets cache size. See GDBM_SETCACHESIZE.

-M
--mmap

Use memory mapping.

-m mode
--mode=mode

Sets the file mode. The argument is the desired file mode in octal.

-n
--no-meta

Do not restore file meta-data (ownership and mode) from the flat file.

-r
--replace

Replace existing keys. This option can be used only together with --update (-U).

-U
--update

Update an existing database. The key/value pairs from the dump file will be added to that database, without removing the existing keys. To overwrite keys that are duplicated in the dump file, use --update --replace.

If the database does not exist, it will be created.

-u owner[:[group]]
--user=owner[:[group]]

Set file owner. The owner can be either a valid user name or UID. Similarly, the group is either a valid group name or GID. If group is not given, the main group of owner is implied, if owner is followed by a ‘:’, otherwise the login group of the current user is implied.

User and group parts can be separated by a dot, instead of the colon, but such usage is discouraged.

-h
--help

Print a concise help summary.

-V
--version

Print program version and licensing information and exit.

--usage

Print a terse invocation syntax summary along with a list of available command line options.


Next: , Previous: , Up: Top   [Contents][Index]