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