Updatedb command
==re-indexes the database used for the locate command==
sudo updatedb
you can have multiple databases, but one is the default
documentation
man updatedb
RUNE_BIND_MOUNTS, PRUNEFS, PRUNENAMES and PRUNEPATHS variables, are documented in detail in updatedb.conf(5)
=> https://linux.die.net/man/5/updatedb.conf :
PRUNEFS : list of FS that should not be scanned
PRUNEPATHS : list ofexact path names of directories that should not be scanned
PRUNENAMES : ist of directory names that should not be scanned
PRUNE_BIND_MOUNTS=”yes” ==> mountpoints with mounted FS should not be scanned
everthing else
index database
default database in “/var/lib/mlocate/mlocate.db”
create a seperate db for a music collection :
cd /media/ward/UD-2TB/entertainment/
sudo updatedb -U /media/ward/UD-2TB/entertainment/music/ --require-visibility 0 --output=/media/ward/UD-2TB/entertainment/locatedbMusic
config
cat /etc/updatedb.conf
xed /etc/updatedb.conf & disown
PRUNE_BIND_MOUNTS=”yes”
– PRUNENAMES=”.git .bzr .hg .svn” { commented out with a # , not a – }
PRUNEPATHS=”/tmp /var/spool /media /var/lib/os-prober /var/lib/ceph /home/.ecryptfs /var/lib/schroot”
PRUNEFS=”NFS afs autofs binfmt_misc ceph cgroup cgroup2 cifs coda configfs curlftpfs debugfs devfs devpts devtmpfs ecryptfs ftpfs fuse.ceph fuse.cryfs fuse.encfs fuse.glusterfs fuse.gvfsd-fuse fuse.mfs fuse.rozofs fuse.sshfs fusectl fusesmb hugetlbfs iso9660 lustre lustre_lite mfs mqueue ncpfs nfs nfs4 ocfs ocfs2 proc pstore rpc_pipefs securityfs shfs smbfs sysfs tmpfs tracefs udev udf usbfs”
run time erros
if failed with msg :
“updatedb: /var/lib/mlocate/mlocate.db is locked (probably by an earlier updatedb)”
=> close the terminal , open a new one and restart the sudo updatedb.