Updatedb

From Notes_Wiki
Revision as of 05:04, 26 March 2013 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>Information_tools|Information tools</yambe:breadcrumb> =updatedb= '<tt>updatedb</tt>' and '<tt>locate</tt>' allow indexing of entire filesystem. Later a fi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>Information_tools|Information tools</yambe:breadcrumb>

updatedb

'updatedb' and 'locate' allow indexing of entire filesystem. Later a file can be searched based on name using the generated index. But sometimes there are filesystems such as encfs or folders such as backup folders, which are not desired to be part of the generated index. In such cases updatedb can be configured to ignore specific file-systems or file-paths by editing '/etc/updatedb.conf' file.


Excluding file-systems

To exclude file-system its name which matches exactly as it appears in '/etc/mtab' entry must be known. For example in case of encfs mounted filesystem '/etc/mtab' shows encfs. Once name of filesystem is known it can be added as a space separated value for variable "PRUNEFS" in /etc/updatedb.conf file.


Excluding folders

To exclude folders such as in case of virtualization openvz base folder /vz or backup folders which contain duplicate copies of other files from updatedb indexing the full-paths of these folders should be added to variable "PRUNEPATHS" in '/etc/updatedb.conf' file.