]> git.sesse.net Git - plocate/blob - updatedb.8.in
Remove dependency on non-POSIX header error.h.
[plocate] / updatedb.8.in
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 <mitr@redhat.com>
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\-e\fR, \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\-\-prune\-bind\-mounts\fR \fIFLAG\fR
98 Set
99 .B PRUNE_BIND_MOUNTS
100 to \fIFLAG\fR, overriding the configuration file.
101
102 .TP
103 \fB\-\-prunefs\fR \fIFS\fR
104 Set \fBPRUNEFS\fR to \fIFS\fR, overriding the configuration file.
105
106 .TP
107 \fB\-\-prunenames\fR \fINAMES\fR
108 Set \fBPRUNENAMES\fR to \fINAMES\fR, overriding the configuration file.
109
110 .TP
111 \fB\-\-prunepaths\fR \fIPATHS\fR
112 Set \fBPRUNEPATHS\fR to \fIPATHS\fR, overriding the configuration file.
113
114 .TP
115 \fB\-l\fR, \fB\-\-require\-visibility\fR \fIFLAG\fR
116 Set the \*(lqrequire file visibility before reporting it\*(rq flag in the
117 generated database to \fIFLAG\fR.
118
119 If
120 .I FLAG
121 is
122 .B 0
123 or \fBno\fR,
124 or if the database file is readable by "others"
125 or it is not owned by \fB@groupname@\fR,
126 .BR locate (1)
127 outputs the database entries even if the user running
128 .BR locate (1)
129 could not have read the directory necessary to find out the file described
130 by the database entry.
131
132 If
133 .I FLAG
134 is
135 .B 1
136 or
137 .B yes
138 (the default),
139 .BR locate (1)
140 checks the permissions of parent directories of each entry
141 before reporting it to the invoking user.
142 To make the file existence truly hidden from other users, the database
143 group is set to
144 .B @groupname@
145 and the database permissions prohibit reading the database by users using
146 other means than
147 .BR locate (1),
148 which is set-gid \fB@groupname@\fR.
149
150 Note that the visibility flag is checked only if the database is owned by
151 .B @groupname@
152 and it is not readable by "others".
153
154 .TP
155 \fB\-v\fR, \fB\-\-verbose\fR
156 Output path names of files to standard output, as soon as they are found.
157
158 .TP
159 \fB\-V\fR, \fB\-\-version\fR
160 Write information about the version and license of
161 .B locate
162 on standard output and exit successfully.
163
164 .SH EXAMPLES
165 To create a private plocate database as a user other than \fBroot\fR,
166 run
167 .RS
168 .B updatedb -l 0 \-o
169 .I db_file
170 .B \-U
171 .I source_directory
172 .RE
173 Note that all users that can read
174 .I db_file
175 can get the complete list of files in the subtree of \fIsource_directory\fR.
176
177 .SH FILES
178 .TP
179 \fB@updatedb_conf@\fR
180 A configuration file.  See
181 .BR updatedb.conf (5).
182 Uses exactly the same format as the one used by
183 .BR mlocate (1)'s
184 updatedb, so they can be shared.
185
186 .TP
187 \fB@dbfile@\fR
188 The database updated by default.
189
190 .SH SECURITY
191 Databases built with
192 .B \-\-require\-visibility no
193 allow users to find names of files and directories of other users,
194 which they would not otherwise be able to do.
195
196 .SH AUTHOR
197 Miloslav Trmac <mitr@redhat.com>
198 .P
199 Steinar H. Gunderson <steinar+plocate@gunderson.no>
200
201 .SH SEE ALSO
202 .BR locate (1),
203 .BR updatedb.conf (5)