Updatedb

From Notes_Wiki

Home > CentOS > CentOS 6.x > Information tools > 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.



Home > CentOS > CentOS 6.x > Information tools > Updatedb