13

Having gone through the /etc/cron.daily directory I noticed that there is only the mlocate.cron file in comparison to what I have seen on other material where they cite slocate.cron. Is there a difference between these and their respective commands and if so what are they?

14

https://fedorahosted.org/mlocate/ explains that mlocate merges databases at each update, which offers a performance speedup since it can skip previously examined files.

They are competing implementations, but mlocate is designed to be backwards compatible with slocate and is slowly replacing it.

  • Thanks. When you say that mlocate merges databases at each update, what does this mean exactly? – PeanutsMonkey Jul 23 '11 at 1:40
  • 4
    @Peanuts, looking at the link provided by Stephanie, it seems that mlocate (which makes a database of file locations) reuses a previous database each time it runs, so any new information is merged with the old information, to save time and give a performance speedup. – pavium Jul 23 '11 at 2:26
  • @pavium - So would this mean that I would have multiple mlocate.cron files? – PeanutsMonkey Jul 23 '11 at 4:44
  • 1
    @peanuts, no, the databases are merged:- the new data generated when the mlocate.cron runs is merged with the old data from the last time it ran. It doesn't mean we need multiple mlocate.cron files. – pavium Jul 23 '11 at 4:56
  • 1
    To be exact, what mlocate does is compare every directory's mtime in the database with the same directory on the filesystem. For any changed directory, mlocate will walk it and any new subdirectory tree behind it, otherwise it just copies the database content for that directory onto the new DB (a temporary file that gets moved over at the end). This can significantly speed up the process on large filesystems; I've personally seen mlocate updates taking only a few hours vs. many days for a brand new database. – Thomas Guyot-Sionnest Jan 28 '16 at 1:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.