| 1 |
.\" A man page for updatedb(8). -*- nroff -*- |
| 2 |
.\" |
| 3 |
.\" Copyright (C) 2005, 2007, 2008 Red Hat, Inc. All rights reserved. |
| 4 |
.\" |
| 5 |
.\" This copyrighted material is made available to anyone wishing to use, |
| 6 |
.\" modify, copy, or redistribute it subject to the terms and conditions of the |
| 7 |
.\" GNU General Public License v.2. |
| 8 |
.\" |
| 9 |
.\" This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 |
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 |
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 12 |
.\" more details. |
| 13 |
.\" |
| 14 |
.\" You should have received a copy of the GNU General Public License along |
| 15 |
.\" with this program; if not, write to the Free Software Foundation, Inc., |
| 16 |
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 |
.\" |
| 18 |
.\" Author: Miloslav Trmac <[email protected]> |
| 19 |
.TH updatedb 8 "Dec 2020" plocate |
| 20 |
|
| 21 |
.SH NAME |
| 22 |
updatedb \- update a database for plocate |
| 23 |
|
| 24 |
.SH SYNOPSIS |
| 25 |
|
| 26 |
\fBupdatedb\fR [\fIOPTION\fR]... |
| 27 |
|
| 28 |
.SH DESCRIPTION |
| 29 |
.B updatedb |
| 30 |
creates or updates a database used by |
| 31 |
.BR locate (1). |
| 32 |
If the database already exists, |
| 33 |
its data is reused |
| 34 |
to avoid rereading directories that have not changed. |
| 35 |
|
| 36 |
.B updatedb |
| 37 |
is usually run daily from a |
| 38 |
.BR systemd.timer (8) |
| 39 |
to update the default database. |
| 40 |
|
| 41 |
.SH EXIT STATUS |
| 42 |
.B updatedb |
| 43 |
returns with exit status 0 on success, 1 on error. |
| 44 |
|
| 45 |
.SH OPTIONS |
| 46 |
The \fBPRUNE_BIND_MOUNTS\fR, \fBPRUNEFS\fR, |
| 47 |
.B PRUNENAMES |
| 48 |
and |
| 49 |
.B PRUNEPATHS |
| 50 |
variables, which are modified by some of the options, are documented in detail |
| 51 |
in |
| 52 |
.BR updatedb.conf (5). |
| 53 |
|
| 54 |
.TP |
| 55 |
\fB\-f\fR, \fB\-\-add-prunefs\fB \fIFS\fR |
| 56 |
Add entries in white-space-separated list \fIFS\fR to \fBPRUNEFS\fR. |
| 57 |
|
| 58 |
.TP |
| 59 |
\fB\-n\fR, \fB\-\-add-prunenames\fB \fINAMES\fR |
| 60 |
Add entries in white-space-separated list \fINAMES\fR to \fBPRUNENAMES\fR. |
| 61 |
|
| 62 |
.TP |
| 63 |
\fB\-e\fR, \fB\-\-add-prunepaths\fB \fIPATHS\fR |
| 64 |
Add entries in white-space-separated list \fIPATHS\fR to \fBPRUNEPATHS\fR. |
| 65 |
|
| 66 |
.TP |
| 67 |
\fB\-\-add-single-prunepath\fB \fIPATH\fR |
| 68 |
Add \fIPATH\fR to \fBPRUNEPATHS\fR. Note that this is currently the only way |
| 69 |
to add a path with a space in it. |
| 70 |
|
| 71 |
.TP |
| 72 |
\fB\-U\fR, \fB\-\-database\-root\fR \fIPATH\fR |
| 73 |
Store only results of scanning the file system subtree rooted at \fIPATH\fR to |
| 74 |
the generated database. |
| 75 |
The whole file system is scanned by default. |
| 76 |
|
| 77 |
.BR locate (1) |
| 78 |
outputs entries as absolute path names which don't contain symbolic links, |
| 79 |
regardless of the form of \fIPATH\fR. |
| 80 |
|
| 81 |
.TP |
| 82 |
\fB\-\-debug\-pruning\fR |
| 83 |
Write debugging information about pruning decisions to standard error output. |
| 84 |
|
| 85 |
.TP |
| 86 |
\fB\-h\fR, \fB\-\-help\fR |
| 87 |
Write a summary of the available options to standard output |
| 88 |
and exit successfully. |
| 89 |
|
| 90 |
.TP |
| 91 |
\fB\-o\fR, \fB\-\-output\fR \fIFILE\fR |
| 92 |
Write the database to |
| 93 |
.I FILE |
| 94 |
instead of using the default database. |
| 95 |
|
| 96 |
.TP |
| 97 |
\fB\-\-config-file\fR \fIFILE\fR |
| 98 |
Read configuration from \fIFILE\fR instead of the default configuration file. |
| 99 |
Command-line options still override settings from the file. |
| 100 |
|
| 101 |
See |
| 102 |
.BR updatedb.conf (5) |
| 103 |
for the configuration file format. |
| 104 |
|
| 105 |
.TP |
| 106 |
\fB\-\-prune\-bind\-mounts\fR \fIFLAG\fR |
| 107 |
Set |
| 108 |
.B PRUNE_BIND_MOUNTS |
| 109 |
to \fIFLAG\fR, overriding the configuration file. |
| 110 |
|
| 111 |
.TP |
| 112 |
\fB\-\-prunefs\fR \fIFS\fR |
| 113 |
Set \fBPRUNEFS\fR to \fIFS\fR, overriding the configuration file. |
| 114 |
|
| 115 |
.TP |
| 116 |
\fB\-\-prunenames\fR \fINAMES\fR |
| 117 |
Set \fBPRUNENAMES\fR to \fINAMES\fR, overriding the configuration file. |
| 118 |
|
| 119 |
.TP |
| 120 |
\fB\-\-prunepaths\fR \fIPATHS\fR |
| 121 |
Set \fBPRUNEPATHS\fR to \fIPATHS\fR, overriding the configuration file. |
| 122 |
|
| 123 |
.TP |
| 124 |
\fB\-l\fR, \fB\-\-require\-visibility\fR \fIFLAG\fR |
| 125 |
Set the \*(lqrequire file visibility before reporting it\*(rq flag in the |
| 126 |
generated database to \fIFLAG\fR. |
| 127 |
|
| 128 |
If |
| 129 |
.I FLAG |
| 130 |
is |
| 131 |
.B 0 |
| 132 |
or \fBno\fR, |
| 133 |
or if the database file is readable by "others" |
| 134 |
or it is not owned by \fBplocate\fR, |
| 135 |
.BR locate (1) |
| 136 |
outputs the database entries even if the user running |
| 137 |
.BR locate (1) |
| 138 |
could not have read the directory necessary to find out the file described |
| 139 |
by the database entry. |
| 140 |
|
| 141 |
If |
| 142 |
.I FLAG |
| 143 |
is |
| 144 |
.B 1 |
| 145 |
or |
| 146 |
.B yes |
| 147 |
(the default), |
| 148 |
.BR locate (1) |
| 149 |
checks the permissions of parent directories of each entry |
| 150 |
before reporting it to the invoking user. |
| 151 |
To make the file existence truly hidden from other users, the database |
| 152 |
group is set to |
| 153 |
.B plocate |
| 154 |
and the database permissions prohibit reading the database by users using |
| 155 |
other means than |
| 156 |
.BR locate (1), |
| 157 |
which is set-gid \fBplocate\fR. |
| 158 |
|
| 159 |
Note that the visibility flag is checked only if the database is owned by |
| 160 |
.B plocate |
| 161 |
and it is not readable by "others". |
| 162 |
|
| 163 |
.TP |
| 164 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 165 |
Output path names of files to standard output, as soon as they are found. |
| 166 |
|
| 167 |
.TP |
| 168 |
\fB\-V\fR, \fB\-\-version\fR |
| 169 |
Write information about the version and license of |
| 170 |
.B locate |
| 171 |
on standard output and exit successfully. |
| 172 |
|
| 173 |
.SH EXAMPLES |
| 174 |
To create a private plocate database as a user other than \fBroot\fR, |
| 175 |
run |
| 176 |
.RS |
| 177 |
.B updatedb -l 0 \-o |
| 178 |
.I db_file |
| 179 |
.B \-U |
| 180 |
.I source_directory |
| 181 |
.RE |
| 182 |
Note that all users that can read |
| 183 |
.I db_file |
| 184 |
can get the complete list of files in the subtree of \fIsource_directory\fR. |
| 185 |
|
| 186 |
.SH FILES |
| 187 |
.TP |
| 188 |
\fB/etc/updatedb.conf\fR |
| 189 |
The default configuration file. See |
| 190 |
.BR updatedb.conf (5). |
| 191 |
Uses exactly the same format as the one used by |
| 192 |
.BR mlocate (1)'s |
| 193 |
updatedb, so they can be shared. |
| 194 |
|
| 195 |
.TP |
| 196 |
\fB/var/lib/plocate/plocate.db\fR |
| 197 |
The database updated by default. |
| 198 |
|
| 199 |
.SH SECURITY |
| 200 |
Databases built with |
| 201 |
.B \-\-require\-visibility no |
| 202 |
allow users to find names of files and directories of other users, |
| 203 |
which they would not otherwise be able to do. |
| 204 |
|
| 205 |
.SH AUTHOR |
| 206 |
Miloslav Trmac <[email protected]> |
| 207 |
.P |
| 208 |
Steinar H. Gunderson <[email protected]> |
| 209 |
|
| 210 |
.SH SEE ALSO |
| 211 |
.BR locate (1), |
| 212 |
.BR updatedb.conf (5) |