updatedb.conf(5)

πŸ“¦
version 1.1.25 Β· 4 versions
, in alpine 3.24, arch rolling, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

/etc/updatedb.conf β€” bestie, it's the config file for updatedb(8). That's it, that's the whole vibe. ✨


🌸 DESCRIPTION 🌸

Okay so /etc/updatedb.conf is a text file. Simple. Iconic. Low maintenance.

  • Blank lines? Ignored. Don't even worry about them. πŸ’…
  • A # character outside of a quoted string starts a comment, and that comment runs until the end of the line. So you can spill your thoughts, bestie, it's fine.

Every other line has to be shaped like this, no exceptions:

VARIABLE = "VALUE"

White space between tokens is ignored β€” so go ahead and make it pretty, the parser does not care. 🌈

  • VARIABLE is an alphanumeric string that does not start with a digit. (so 1vibes is out, sorry 😭)
  • VALUE can contain any character except ". There is no escape mechanism supported inside VALUE, and there is no way to write a VALUE that spans more than one line. One line only, queen. πŸ‘‘
Unknown VARIABLE values are considered an error. Not a warning, not a suggestion. An error. The file does not tolerate mystery variables. πŸ’€

Here are the variables that actually exist:

  • PRUNEFS β€” a whitespace-separated list of file system types (the kind used in /etc/mtab) that should not be scanned by updatedb(8). The file system type matching is case-insensitive. By default, no file system types are skipped.
Heads up: when scanning a file system is skipped, all file systems mounted in the subtree are skipped too β€” even if their type does not match any entry in PRUNEFS. It cascades, bestie. πŸ¦‹
  • PRUNENAMES β€” a whitespace-separated list of directory names (without paths, just the names) that should not be scanned by updatedb(8). By default, no directory names are skipped.
Note: only directories can be specified here, and no pattern mechanism (like globbing) is used. No wildcards, no regex, no ✨magic✨. Just names.
  • PRUNEPATHS β€” a whitespace-separated list of path names of directories that should not be scanned by updatedb(8). Each path name must be exactly in the form in which the directory would be reported by locate(1). Like, exact-exact. 🎯

By default, no paths are skipped.

  • PRUNE_BIND_MOUNTS β€” one of the strings 0, no, 1 or yes. If PRUNE_BIND_MOUNTS is 1 or yes, bind mounts are not scanned by updatedb(8). All file systems mounted in the subtree of a bind mount are skipped as well, even if they are not bind mounts. 🫢
Exception alert: bind mounts of a directory on itself are not skipped.
Also important: Btrfs subvolume mounts are handled internally in the kernel as bind mounts (see btrfs-subvolume(8)), and thus may get skipped if you have also mounted the filesystem root itself. To counteract this, make your root directory a Btrfs subvolume, too. Problem solved, you're welcome. πŸ’œ

By default, bind mounts are not skipped.


πŸ’– NOTES πŸ’–

Okay this part is the the way that… section, because the behavior is a little quirky and you need to know it:

When a directory is matched by PRUNEFS, PRUNENAMES or PRUNEPATHS, updatedb(8) does not scan the contents of the directory. The path of the directory itself is, however, entered in the created database. πŸ—‚οΈ

Example time, bestie: if /tmp is in PRUNEPATHS, then locate(1) will not show any files stored in /tmp, but it can show the /tmp directory. Yes, really. This behavior differs from traditional locate implementations. It's giving main character energy, honestly. πŸ‘‘

Also: in some updatedb(8) implementations, PRUNEPATHS can be used to exclude non-directory files. This is not the case in this implementation. Nope. Not here. 🚫

And finally β€” in some implementations, /etc/updatedb.conf is a shell script, which allows much more flexibility in defining the variables. If that's the energy you crave, you can get equivalent functionality by using the command-line options to updatedb(8). Go off. πŸ”₯


✨ AUTHOR ✨

Miloslav Trmac <mitr@redhat.com> β€” the icon, the legend, the moment. 🫢


🌈 SEE ALSO 🌈


And that's the whole page, bestie β€” brought to you by plocate, dated Oct 2020. It's giving manual-page royalty, ngl. Stay pruned. πŸ’…πŸŽ€βœ¨