summaryrefslogtreecommitdiff
path: root/locate/updatedb.1
blob: dc2c491149691770ec9027b7443ebac2171ff74d (plain)
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
.TH UPDATEDB 1 \" -*- nroff -*-
.SH NAME
updatedb \- update a file name database
.SH SYNOPSIS
.B updatedb [\fIoptions\fP]
.SH DESCRIPTION
This manual page
documents the GNU version of
.BR updatedb ,
which updates file name databases used by GNU
.BR locate .
The file name databases contain lists of files that were in
particular directory trees when the databases were last updated.
The file name of the default database is determined when \fBlocate\fP
and \fBupdatedb\fP are configured and installed.  The frequency with
which the databases are updated and the directories for which they
contain entries depend on how often \fBupdatedb\fP is run, and with
which arguments.
.P
In networked environments, it often makes sense to build a database at
the root of each filesystem, containing the entries for that filesystem.
.B updatedb
is then run for each filesystem on the fileserver where that
filesystem is on a local disk, to prevent thrashing the network.
Users can select which databases \fBlocate\fP searches using an
environment variable or command line option; see \fBlocate\fP(1).
Databases cannot be concatenated together.
.P
The
.B LOCATGE02
database format was introduced in GNU findutils
version 4.0 in order to allow machines with different byte orderings
to share the databases.  GNU
.B locate
can read both the old and
.B LOCATE02
database formats, though
support for the old pre-4.0 database format will be removed shortly.

.SH OPTIONS
.TP
.B \-\-findoptions='\fI\-option1 \-option2...\fP'
Global options to pass on to \fBfind\fP.
The environment variable \fBFINDOPTIONS\fP also sets this value.
Default is none.
.TP
.B \-\-localpaths='\fIpath1 path2...\fP'
Non-network directories to put in the database.
Default is /.
.TP
.B \-\-netpaths='\fIpath1 path2...\fP'
Network (NFS, AFS, RFS, etc.) directories to put in the database.
The environment variable \fBNETPATHS\fP also sets this value.
Default is none.
.TP
.B \-\-prunepaths='\fIpath1 path2...\fP'
Directories to not put in the database, which would otherwise be.
Remove any trailing slashes from the path names, otherwise
.B updatedb
won't recognise the paths you want to omit (because it uses them as
regular expression patterns).
The environment variable \fBPRUNEPATHS\fP also sets this value.
Default is /tmp /usr/tmp /var/tmp /afs.
.TP
.B \-\-prunefs='\fIpath...\fP'
File systems to not put in the database, which would otherwise be.
Note that files are pruned when a file system is reached;
any file system mounted under an undesired file system will be
ignored.
The environment variable
\fBPRUNEFS\fP also sets this value.
Default is \fInfs NFS proc\fP.
.TP
.B \-\-output=\fIdbfile\fP
The database file to build.
Default is system-dependent.  In Debian GNU/Linux, the default
is /var/cache/locate/locatedb.
.TP
.B \-\-localuser=\fIuser\fP
The user to search non-network directories as, using \fBsu\fP(1).
Default is to search the non-network directories as the current user.
You can also use the environment variable \fBLOCALUSER\fP to set this user.
.TP
.B \-\-netuser=\fIuser\fP
The user to search network directories as, using \fBsu\fP(1).
Default is \fBdaemon\fP.
You can also use the environment variable \fBNETUSER\fP to set this user.
.TP
.B \-\-dbformat=F
Create the database in format F.  The default format is called LOCATE02.
Alternatively the
.B slocate
format is also supported.  When the
.B slocate
format is in use, the database produced is marked as having security
level 1.  If you want to build a system-wide
.B slocate
database, you may want to run
.B updatedb
as root.
.TP
.B \-\-version
Print the version number of
.B updatedb
and exit.
.TP
.B "\-\-help"
Print a summary of the options to
.B updatedb
and exit.
.SH "SEE ALSO"
\fBfind\fP(1), \fBlocate\fP(1), \fBlocatedb\fP(5), \fBxargs\fP(1)

The full documentation for
.B updatedb
is maintained as a Texinfo manual.  If the
.B info
and
.B updatedb
programs are properly installed at your site, the command
.B info updatedb
should give you access to the complete manual.

.SH COPYRIGHT
Copyright \(co 1994-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

.SH "BUGS"
The
.B updatedb
program correctly handles filenames containing newlines,
but only if the system's sort command has a working
.I \-z
option.  If you suspect that
.B locate
may need to return filenames containing newlines, consider using its
.I \-\-null
option.
.P
The best way to report a bug is to use the form at
https://savannah.gnu.org/bugs/?group=findutils.
The reason for this is that you will then be able to track progress in
fixing the problem.   Other comments about \fBupdatedb\fP(1) and about
the findutils package in general can be sent to the
.I bug-findutils
mailing list.  To join the list, send email to
.IR bug-findutils-request@gnu.org .