updatedb for a beginner

coffeemonitor

The updatedb command, as I understand it, is basically the utility that keeps the mlocate.db database file updated. And it's a good idea to keep it updated regularly.

For that matter, I've kept a daily cron to run the updatedb command. Now I'm looking under the hood, for the sake of understanding it better.

When I cat /etc/updatedb.conf I see a few options:

PURNE_BIND_MOUNTS
PRUNENAMES
PRUNESPATHS
PRUNEFS

These options, as I read the manpage and other sites, let updatedb know to skip scanning specific files or directories on the file system.

So, here's my question.

Why would we want to skip indexing anything at all?
Obviously there must be good moments for it.

phoops

First there's an error in your updatedb.conf as it says PURNE_BIND_MOUNTS when it should be PRUNE_BIND_MOUNTS.

Now to answer your question, there are various reasons why you might want to ignore indexing specific directories:

  1. PRUNE_BIND_MOUNTS - prevents from indexing bind mounts. bind mounts allow you to mount a specific folder or device on the filesystem more than once. There will never be any differences between the two, so most of the time there would be no point to index them twice.

  2. NFS/Remotes - you might not want to index remote filesystem mounts on a local filesystem, as that might be slow or not even needed.

  3. Temporary directories (/tmp) which often change or are updated. You might not want to index them either.

There might be cases when you might have any other specific directories which you only want to index for quick locating of files, you might even not want to index your system files at all and keep it to specific/personal directories.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related