Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mlocate.db(5) [debian man page]

mlocate.db(5)							File Formats Manual						     mlocate.db(5)

NAME
mlocate.db - a mlocate database DESCRIPTION
A mlocate database starts with a file header: 8 bytes for a magic number ("mlocate" like a C literal), 4 bytes for the configuration block size in big endian, 1 byte for file format version (0), 1 byte for the "require visibility" flag (0 or 1), 2 bytes padding, and a NUL-terminated path name of the root of the database. The header is followed by a configuration block, included to ensure databases are not reused if some configuration changes could affect their contents. The size of the configuration block in bytes is stored in the file header. The configuration block is a sequence of vari- able assignments, ordered by variable name. Each variable assignment consists of a NUL-terminated variable name and an ordered list of NUL-terminated values. The value list is terminated by one more NUL character. The ordering used is defined by the strcmp () function. Currently defined variables are: prune_bind_mounts A single entry, the value of PRUNE_BIND_MOUNTS; one of the strings 0 or 1. prunefs The value of PRUNEFS, each entry is converted to uppercase. prunepaths The value of PRUNEPATHS. The rest of the file until EOF describes directories and their contents. Each directory starts with a header: 8 bytes for directory time (seconds) in big endian, 4 bytes for directory time (nanoseconds) in big endian (0 if unknown, less than 1,000,000,000), 4 bytes padding, and a NUL-terminated path name of the the directory. Directory contents, a sequence of file entries sorted by name, follow. Directory time is the maximum of st_ctime and st_mtime of the directory. updatedb(8) uses the original data if the directory time in the database and in the file system match exactly. Directory time equal to 0 always causes rescanning of the directory: this is necessary to handle directories which were being updated while building the database. Each file entry starts with a single byte, marking its type: 0 A non-directory file. Followed by a NUL-terminated file (not path) name. 1 A subdirectory. Followed by a NUL-terminated file (not path) name. 2 Marks the end of the current directory. locate(1) only reports file entries, directory names are not reported because they are reported as an entry in their parent directory. The only exception is the root directory of the database, which is stored in the file header. AUTHOR
Miloslav Trmac <mitr@redhat.com> SEE ALSO
locate(1), updatedb.conf(5), updatedb(8) mlocate Jan 2007 mlocate.db(5)

Check Out this Related Man Page

updatedb(8)						      System Manager's Manual						       updatedb(8)

NAME
updatedb - update a database for mlocate SYNOPSIS
updatedb [OPTION]... DESCRIPTION
updatedb creates or updates a database used by locate(1). If the database already exists, its data is reused to avoid rereading directo- ries that have not changed. updatedb is usually run daily by cron(8) to update the default database. EXIT STATUS
updatedb returns with exit status 0 on success, 1 on error. OPTIONS
The PRUNE_BIND_MOUNTS, PRUNEFS, PRUNENAMES and PRUNEPATHS variables, which are modified by some of the options, are documented in detail in updatedb.conf(5). -f, --add-prunefs FS Add entries in white-space-separated list FS to PRUNEFS. -n, --add-prunenames NAMES Add entries in white-space-separated list NAMES to PRUNENAMES. -e, --add-prunepaths PATHS Add entries in white-space-separated list PATHS to PRUNEPATHS. -U, --database-root PATH Store only results of scanning the file system subtree rooted at PATH to the generated database. The whole file system is scanned by default. locate(1) outputs entries as absolute path names which don't contain symbolic links, regardless of the form of PATH. --debug-pruning Write debugging information about pruning decisions to standard error output. -h, --help Write a summary of the available options to standard output and exit successfully. -o, --output FILE Write the database to FILE instead of using the default database. --prune-bind-mounts FLAG Set PRUNE_BIND_MOUNTS to FLAG, overriding the configuration file. --prunefs FS Set PRUNEFS to FS, overriding the configuration file. --prunenames NAMES Set PRUNENAMES to NAMES, overriding the configuration file. --prunepaths PATHS Set PRUNEPATHS to PATHS, overriding the configuration file. -l, --require-visibility FLAG Set the "require file visibility before reporting it" flag in the generated database to FLAG. If FLAG is 0 or no, or if the database file is readable by "others" or it is not owned by mlocate, locate(1) outputs the database entries even if the user running locate(1) could not have read the directory necessary to find out the file described by the data- base entry. If FLAG is 1 or yes (the default), locate(1) checks the permissions of parent directories of each entry before reporting it to the invoking user. To make the file existence truly hidden from other users, the database group is set to mlocate and the database per- missions prohibit reading the database by users using other means than locate(1), which is set-gid mlocate. Note that the visibility flag is checked only if the database is owned by mlocate and it is not readable by "others". -v, --verbose Output path names of files to standard output, as soon as they are found. -V, --version Write information about the version and licence of locate on standard output and exit successfully. EXAMPLES
To create a private mlocate database as an user other than root, run updatedb -l 0 -o db_file -U source_directory Note that all users that can read db_file can get the complete list of files in the subtree of source_directory. FILES
/etc/updatedb.conf A configuration file. See updatedb.conf(5). /var/lib/mlocate/mlocate.db The database updated by default. SECURITY
Databases built with --require-visibility no allow users to find names of files and directories of other users, which they would not other- wise be able to do. NOTES
The accompanying locate(1) utility was designed to be compatible to slocate and attempts to be compatible to GNU locate where possible. This is not the case for updatedb. AUTHOR
Miloslav Trmac <mitr@redhat.com> SEE ALSO
locate(1), mlocate.db(5), updatedb.conf(5) mlocate Jun 2008 updatedb(8)
Man Page