Support the generation of slocate-format databases
[findutils.git] / locate / updatedb.1
blobe42ec74cabcc222f5080dfd47418370ddee57498
1 .TH UPDATEDB 1 \" -*- nroff -*-
2 .SH NAME
3 updatedb \- update a file name database
4 .SH SYNOPSIS
5 .B updatedb [\fIoptions\fP]
6 .SH DESCRIPTION
7 This manual page
8 documents the GNU version of
9 .BR updatedb ,
10 which updates file name databases used by GNU
11 .BR locate .
12 The file name databases contain lists of files that were in
13 particular directory trees when the databases were last updated.
14 The file name of the default database is determined when \fBlocate\fP
15 and \fBupdatedb\fP are configured and installed.  The frequency with
16 which the databases are updated and the directories for which they
17 contain entries depend on how often \fBupdatedb\fP is run, and with
18 which arguments.
20 In networked environments, it often makes sense to build a database at
21 the root of each filesystem, containing the entries for that filesystem.
22 .B updatedb
23 is then run for each filesystem on the fileserver where that
24 filesystem is on a local disk, to prevent thrashing the network.
25 Users can select which databases \fBlocate\fP searches using an
26 environment variable or command line option; see \fBlocate\fP(1).
27 Databases can not be concatenated together.
29 The file name database format changed starting with GNU
30 .B find
31 and
32 .B locate
33 version 4.0 to allow machines with different byte orderings to share
34 the databases.  The new GNU
35 .B locate
36 can read both the old and new database formats.
37 However, old versions of
38 .B locate
39 and
40 .B find
41 produce incorrect results if given a new-format database.
42 .SH OPTIONS
43 .TP
44 .B \-\-findoptions='\fI\-option1 \-option2...\fP'
45 Global options to pass on to \fBfind\fP.
46 The environment variable \fBFINDOPTIONS\fP also sets this value.
47 Default is none.
48 .TP
49 .B \-\-localpaths='\fIpath1 path2...\fP'
50 Non-network directories to put in the database.
51 Default is /.
52 .TP
53 .B \-\-netpaths='\fIpath1 path2...\fP'
54 Network (NFS, AFS, RFS, etc.) directories to put in the database.
55 The environment variable \fBNETPATHS\fP also sets this value.
56 Default is none.
57 .TP
58 .B \-\-prunepaths='\fIpath1 path2...\fP'
59 Directories to not put in the database, which would otherwise be.
60 Remove any trailing slashes from the path names, otherwise 
61 .B updatedb
62 won\'t recognise the paths you want to omit (because it uses them as
63 regular expression patterns).
64 The environment variable \fBPRUNEPATHS\fP also sets this value.
65 Default is /tmp /usr/tmp /var/tmp /afs.
66 .TP
67 .B \-\-prunefs='\fIpath...\fP'
68 File systems to not put in the database, which would otherwise be.
69 Note that files are pruned when a file system is reached;
70 Any file system mounted under an undesired file system will be
71 ignored.
72 The environment variable
73 \fBPRUNEFS\fP also sets this value.
74 Default is \fInfs NFS proc\fP.
75 .TP
76 .B \-\-output=\fIdbfile\fP
77 The database file to build.
78 Default is system-dependent.  In Debian GNU/Linux, the default
79 is /var/cache/locate/locatedb.
80 .TP
81 .B \-\-localuser=\fIuser\fP
82 The user to search non-network directories as, using \fBsu\fP(1).
83 Default is to search the non-network directories as the current user.
84 You can also use the environment variable \fBLOCALUSER\fP to set this user.
85 .TP
86 .B \-\-netuser=\fIuser\fP
87 The user to search network directories as, using \fBsu\fP(1).
88 Default is \fBdaemon\fP.
89 You can also use the environment variable \fBNETUSER\fP to set this user.
90 .TP
91 .B \-\-old\-format
92 Create the database in the old format.  This is a synonym for 
93 .BR \-\-dbformat=old .
94 .TP
95 .B \-\-dbformat=F
96 Create the database in format F.  The default format is called LOCATE02.
97 F can be 
98 .B old
99 to select the old database format (this is the same as specifying
100 .BR \-\-old\-format ).
101 Alternatively the 
102 .B slocate
103 format is also supported.  When the 
104 .B slocate 
105 format is in use, the database produced is marked as having security
106 level 1.  If you want to build a system-wide
107 .B slocate
108 database, you may want to run 
109 .B updatedb
110 as root.
112 .B \-\-version
113 Print the version number of
114 .B updatedb
115 and exit.
117 .B "\-\-help"
118 Print a summary of the options to
119 .B updatedb
120 and exit.
121 .SH "SEE ALSO"
122 \fBfind\fP(1), \fBlocate\fP(1), \fBlocatedb\fP(5), \fBxargs\fP(1)
123 \fBFinding Files\fP (on-line in Info, or printed)
124 .SH "BUGS"
126 The 
127 .B updatedb
128 program correctly handles filenames containing newlines,
129 but only if the system's sort command has a working
130 .I \-z
131 option.  If you suspect that 
132 .B locate
133 may need to return filenames containing newlines, consider using its
134 .I \-\-null 
135 option.
137 The best way to report a bug is to use the form at
138 http://savannah.gnu.org/bugs/?group=findutils.  
139 The reason for this is that you will then be able to track progress in
140 fixing the problem.   Other comments about \fBupdatedb\fP(1) and about
141 the findutils package in general can be sent to the 
142 .I bug-findutils
143 mailing list.  To join the list, send email to 
144 .IR bug-findutils-request@gnu.org .