LinuxCommandLibrary

tdbtool

Manipulate TDB (Trivial Database) files

SYNOPSIS

tdbtool tdbfile command [arguments...]

PARAMETERS

tdbfile
    The path to the TDB file to be manipulated.

check
    Check the database for consistency and structural integrity.

dump
    Dump all key/value pairs stored in the database in a human-readable format.

info
    Display general information about the database file.

create
    Create a new, empty TDB file.

list
    List all keys present in the database.

exists key
    Check if a key exists in the database.

fetch key
    Retrieve the value associated with a key.

store key value
    Store a value associated with a key. Overwrites existing entries.

delete key
    Delete the entry associated with a key.

mktree prefix depth
    Create a test tree rooted at the given prefix.

stats
    Show detailed usage of the database.

freelist
    Show the freelist.

wipe
    Wipe all data from the tdb file.

resize
    Resize a database.

help
    Show a list of commands

DESCRIPTION

The `tdbtool` command is a utility for manipulating and inspecting Trivial Database (`TDB`) files. TDB is a simple database library designed for storing key/value pairs in a file. `tdbtool` allows users to create, dump, modify, and analyze TDB files. It provides a command-line interface for performing operations such as listing records, adding new records, deleting existing records, and examining the internal structure of the database. This tool is particularly useful for developers working with applications that utilize TDB for data storage, as it provides a convenient way to debug and maintain TDB files. It is especially helpful for checking file contents and repairing corrupt tdb files.

CAVEATS

TDB files are not designed for concurrent access from multiple processes. Using `tdbtool` to modify a TDB file while another process is accessing it can lead to data corruption. Always ensure that no other process is using the TDB file before using `tdbtool` to make changes.

ERROR HANDLING

`tdbtool` may exit with a non-zero status code if it encounters errors such as a corrupted database file or invalid command arguments. Pay attention to the exit code when using `tdbtool` in scripts.

SECURITY CONSIDERATIONS

Care should be taken when storing sensitive information in TDB files. While the TDB format itself does not provide encryption, it is possible to encrypt the entire TDB file using standard file encryption tools. Also be aware of user permissions for the tdbfile.

HISTORY

The `tdbtool` command is part of the TDB library, which was developed as a simple and efficient database solution. Its creation was driven by the need for a lightweight database that could be easily embedded in applications. Usage of `tdbtool` has grown alongside the adoption of the TDB library in various software projects, particularly in Samba and other network-related tools.

SEE ALSO

gdbmtool(1), dbmtool(1)

Copied to clipboard