#39 custom database location
Opened by vumi. Modified

Updatedb create database at '/var/lib/mlocate/mlocate.db'.
I have an SSD disk and cron configured to update database at each hour. Updating database process may break my disk.
I want to move this file to custom location. For example - to '/tmp', which mounted as tmpfs.

Please, add an option to configure custom location of database file.

For example:
- make flag 'customdblocation' indicate to build program with supporting function "custom location of database file';
- option like 'DBFILE' at '/etc/updatedb.conf' specify the full path to database file 'mlocate.db';
- 'locate' program read and use 'DBFILE' variable from '/etc/updatedb.conf' at each start.

And I think, that configure file 'updatedb.conf' need to be changed to 'mlocate.conf'.

Thank you!


mlocate may use environment variable like 'MLOCATEDBFILE' to take the full path to database file.

Thanks for your report. Can’t this ''already'' be all easily done?

  • Run configure --localstatedir=/parent/for/directory/mlocate
  • Edit your system’s script running updatedb to add --output=…
  • Set an alias for locate to locate --database=…
Metadata