:: Re: [DNG] updatedb ignores PRUNEPAT…
Forside
Slet denne besked
Besvar denne besked
Skribent: Joel Roth
Dato:  
Til: dng
Emne: Re: [DNG] updatedb ignores PRUNEPATHS in updatedb.conf
On Thu, Oct 25, 2018 at 08:42:31PM +0000, Rob wrote:
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Thursday, 25 October 2018 18:51, Joel Roth <joelz@???> wrote:
>
> > Hi all,
> >
> > updatedb has been around for so long, I'm sure it works
> > as advertised, but when I add the paths of my external
> > devices, they still get probed.
> >
> > First I tried adding /mnt then the specific mount point /mnt/matte
> > but still gets searched.
> >
> > Here is the entire config file.
> >
> > PRUNE_BIND_MOUNTS="yes"
> > PRUNENAMES=".git .bzr .hg .svn"
> > PRUNEPATHS="/tmp /var/spool /media /var/lib/os-prober /var/lib/ceph /mnt/red /mnt/matte"
> > PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs devtmpfs fuse.mfs shfs sysfs cifs lustre tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs ceph fuse.ceph fuse.rozofs"
> >
> > Any suggestions, pointers, etc. would be welcome.
> >
> >
> > Joel Roth
>
> Possibly might be relevant:
>
> https://serverfault.com/questions/454051/how-can-i-view-updatedb-database-content-and-then-exclude-certain-files-paths


This answer suggests behavior is different depending on
having locate or mlocate. I had both installed. And after
removing/installing locate /usr/bin/locate still points to
/etc/alternatives/locate which points to /usr/bin/mlocate.

And according to docs, locate/mlocate only *reads* the
database generated by updatedb.

However package mlocate contains updatedb.mlocate.
And package locate contains updated.findutils

/etc/cron.daily/mlocate invokes updatedb.mlocate
/etc/cron.daily/locate invokes updatedb.findutils

Looking into the latter, I see that PRUNEPATHS and other
environment variables for updatedb are hardcoded.
Except that the crondaily/locate also includes this snippet:

    # allow keeping local customizations in a separate file
    if [ -r /etc/updatedb.findutils.cron.local ] ; then
        . /etc/updatedb.findutils.cron.local
    fi


So, it looks like a bit of a mess in coding a
mess in documentation. Some sort of bug report
may be in order, if I can decide what the bug is.

'man updatedb.conf' is misleading if updatedb.conf
settings are superseded by /etc/cron.daily/updatedb.locate.
But looking into the precise cron entry is obviously
mandatory to understand what is going on in a cron job.

Probably its a bug/weird engineering decision of the locate
package to prefer its own customizations file to
updatedb.conf.

Also I recall that I still received wrong answers from
locate (containing the paths I excluded) until I removed
/var/cache/locate/locatedb. Note that mlocate stores its
database in /var/lib/mlocate/mlocatedb.

(BTW, the reason I needed to tweak these config settings is
that my time-machine style backups were requiring a long
time to scan due to the large number of hardlinks, and this
was conflicting with some video rendering. OTOH, it also
could be nice to know which backups contain which files.)

cheers

--
Joel Roth