man-pages/man8/updatedb.mlocate.8.html
2021-03-31 01:06:50 +01:00

266 lines
6.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of updatedb</TITLE>
</HEAD><BODY>
<H1>updatedb</H1>
Section: Maintenance Commands (8)<BR>Updated: Jun 2008<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<P>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
updatedb - update a database for mlocate
<P>
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>updatedb</B> [<I>OPTION</I>]...
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>updatedb</B>
creates or updates a database used by
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1).
If the database already exists,
its data is reused
to avoid rereading directories that have not changed.
<P>
<B>updatedb</B>
is usually run daily by
<B><A HREF="/cgi-bin/man/man2html?8+cron">cron</A></B>(8)
to update the default database.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>EXIT STATUS</H2>
<B>updatedb</B>
returns with exit status 0 on success, 1 on error.
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>OPTIONS</H2>
The <B>PRUNE_BIND_MOUNTS</B>, <B>PRUNEFS</B>,
<B>PRUNENAMES</B>
and
<B>PRUNEPATHS</B>
variables, which are modified by some of the options, are documented in detail
in
<B><A HREF="/cgi-bin/man/man2html?5+updatedb.conf">updatedb.conf</A></B>(5).
<P>
<DL COMPACT>
<DT id="1"><B>-f</B>, <B>--add-prunefs </B><I>FS</I><DD>
Add entries in white-space-separated list <I>FS</I> to <B>PRUNEFS</B>.
<P>
<DT id="2"><B>-n</B>, <B>--add-prunenames </B><I>NAMES</I><DD>
Add entries in white-space-separated list <I>NAMES</I> to <B>PRUNENAMES</B>.
<P>
<DT id="3"><B>-e</B>, <B>--add-prunepaths </B><I>PATHS</I><DD>
Add entries in white-space-separated list <I>PATHS</I> to <B>PRUNEPATHS</B>.
<P>
<DT id="4"><B>-U</B>, <B>--database-root</B> <I>PATH</I><DD>
Store only results of scanning the file system subtree rooted at <I>PATH</I> to
the generated database.
The whole file system is scanned by default.
<P>
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1)
outputs entries as absolute path names which don't contain symbolic links,
regardless of the form of <I>PATH</I>.
<P>
<DT id="5"><B>--debug-pruning</B><DD>
Write debugging information about pruning decisions to standard error output.
<P>
<DT id="6"><B>-h</B>, <B>--help</B><DD>
Write a summary of the available options to standard output
and exit successfully.
<P>
<DT id="7"><B>-o</B>, <B>--output</B> <I>FILE</I><DD>
Write the database to
<I>FILE</I>
instead of using the default database.
<P>
<DT id="8"><B>--prune-bind-mounts</B> <I>FLAG</I><DD>
Set
<B>PRUNE_BIND_MOUNTS</B>
to <I>FLAG</I>, overriding the configuration file.
<P>
<DT id="9"><B>--prunefs</B> <I>FS</I><DD>
Set <B>PRUNEFS</B> to <I>FS</I>, overriding the configuration file.
<P>
<DT id="10"><B>--prunenames</B> <I>NAMES</I><DD>
Set <B>PRUNENAMES</B> to <I>NAMES</I>, overriding the configuration file.
<P>
<DT id="11"><B>--prunepaths</B> <I>PATHS</I><DD>
Set <B>PRUNEPATHS</B> to <I>PATHS</I>, overriding the configuration file.
<P>
<DT id="12"><B>-l</B>, <B>--require-visibility</B> <I>FLAG</I><DD>
Set the ``require file visibility before reporting it'' flag in the
generated database to <I>FLAG</I>.
<P>
If
<I>FLAG</I>
is
<B>0</B>
or <B>no</B>,
or if the database file is readable by &quot;others&quot;
or it is not owned by <B>mlocate</B>,
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1)
outputs the database entries even if the user running
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1)
could not have read the directory necessary to find out the file described
by the database entry.
<P>
If
<I>FLAG</I>
is
<B>1</B>
or
<B>yes</B>
(the default),
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(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
<B>mlocate</B>
and the database permissions prohibit reading the database by users using
other means than
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1),
which is set-gid <B>mlocate</B>.
<P>
Note that the visibility flag is checked only if the database is owned by
<B>mlocate</B>
and it is not readable by &quot;others&quot;.
<P>
<DT id="13"><B>-v</B>, <B>--verbose</B><DD>
Output path names of files to standard output, as soon as they are found.
<P>
<DT id="14"><B>-V</B>, <B>--version</B><DD>
Write information about the version and license of
<B>locate</B>
on standard output and exit successfully.
<P>
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>EXAMPLES</H2>
To create a private mlocate database as an user other than <B>root</B>,
run
<DL COMPACT><DT id="15"><DD>
<B>updatedb -l 0 -o</B>
<I>db_file</I>
<B>-U</B>
<I>source_directory</I>
</DL>
Note that all users that can read
<I>db_file</I>
can get the complete list of files in the subtree of <I>source_directory</I>.
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>FILES</H2>
<DL COMPACT>
<DT id="16"><B>/etc/updatedb.conf</B><DD>
A configuration file. See
<B><A HREF="/cgi-bin/man/man2html?5+updatedb.conf">updatedb.conf</A></B>(5).
<P>
<DT id="17"><B>/var/lib/mlocate/mlocate.db</B><DD>
The database updated by default.
<P>
</DL>
<A NAME="lbAI">&nbsp;</A>
<H2>SECURITY</H2>
Databases built with
<B>--require-visibility no</B>
allow users to find names of files and directories of other users,
which they would not otherwise be able to do.
<P>
<A NAME="lbAJ">&nbsp;</A>
<H2>NOTES</H2>
The accompanying
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1)
utility was designed to be compatible to
<B>slocate</B>
and attempts to be compatible to
<FONT SIZE="-1">GNU</FONT>
<B>locate</B>
where possible.
This is not the case for <B>updatedb</B>.
<P>
<A NAME="lbAK">&nbsp;</A>
<H2>AUTHOR</H2>
Miloslav Trmac &lt;<A HREF="mailto:mitr@redhat.com">mitr@redhat.com</A>&gt;
<P>
<A NAME="lbAL">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?5+mlocate.db">mlocate.db</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?5+updatedb.conf">updatedb.conf</A></B>(5)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="18"><A HREF="#lbAB">NAME</A><DD>
<DT id="19"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="20"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="21"><A HREF="#lbAE">EXIT STATUS</A><DD>
<DT id="22"><A HREF="#lbAF">OPTIONS</A><DD>
<DT id="23"><A HREF="#lbAG">EXAMPLES</A><DD>
<DT id="24"><A HREF="#lbAH">FILES</A><DD>
<DT id="25"><A HREF="#lbAI">SECURITY</A><DD>
<DT id="26"><A HREF="#lbAJ">NOTES</A><DD>
<DT id="27"><A HREF="#lbAK">AUTHOR</A><DD>
<DT id="28"><A HREF="#lbAL">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:18 GMT, March 31, 2021
</BODY>
</HTML>