What is /etc/updatedb.conf

| May 26, 2011 | 0 Comments

/etc/updatedb.conf

This file is used to configure the command updatedb. Updatedb is a command to maintain a database of files and folders of your system which can be later searched by the command locate.
Updatedb database is used to search file on linu system, with locate command.

locate file

The locate command look in updatedb database and return the results.

To update the database, use the following command

updatedb

Sample content of the file updatedb.conf is given below.

PRUNEFS="devpts NFS nfs afs sfs proc smbfs autofs auto iso9660"
PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /net /sfs"
export PRUNEFS
export PRUNEPATHS

As from above we can see variabled and their values set up, lets discuss those.

PRUNEFS
All the file system specified in this variable are skipped when we run the updatedb command. Thus any file present in these file systems are not found using the locate command.

PRUNENAMES
Here any directory name can be specified which will be skipped by updatedb.

PRUNEPATHS
A  whitespace-separated list of path names of directories which should not be scanned by updatedb(8).  Each path name must be exactly in the form in which the
directory would be reported by locate(1).

By default, no paths are skipped.

PRUNE_BIND_MOUNTS
One of the strings 0, no, 1 or yes.  If PRUNE_BIND_MOUNTS is 1 or yes, bind mounts are not scanned by updatedb(8).  All file systems mounted in the subtree of
a bind mount are skipped as well, even if they are not bind mounts.

By default, bind mounts are not skipped.

NOTES
When a directory is matched by PRUNEFS, PRUNENAMES or PRUNEPATHS, updatedb(8) does not scan the contents of the directory.  The path of the directory itself is, how-
ever, entered in the created database.  For example, if /tmp is in PRUNEPATHS, locate(1) will not show any files stored in /tmp, but it can show the /tmp  directory.
This behavior differs from traditional locate implementations.

In some updatedb(8) implementations PRUNEPATHS can be used to exclude non-directory files.  This is not the case in this implementation.

/etc/updatedb.conf is a shell script in some implementations, which allows much more flexibility in defining the variables.  Equivalent functionality can be achieved by using the command-line options to updatedb(8).



  • Digg
  • Facebook
  • Twitter
  • Google Bookmarks
  • LinkedIn
  • RSS

No related posts.

Tags:

Category: Linux, Software, Technology

Leave a Reply

*