How do I edit the update.conf at /etc/update.conf to run every day on Ubuntu? This would enable me to use locate with a very recent database.

I read this:

default setting, updatedb, it has been in /etc/cron.daily and its name is slocate.cron if you want to run updatedb on startup, you can add the line updatebd to the file /etc/rc.d/rc.local.

In FC4 you must edit the file /etc/updatedb.conf and set DAILY_UPDATE=yes.

But that is for Fedora.

  • 4
    afaik Ubuntu already does this daily? – Rinzwind Oct 20 '12 at 14:54

From http://manpages.ubuntu.com/manpages/oneiric/en/man8/updatedb.8.html

updatedb is usually run daily by cron(8) to update the default database.

Check /etc/cron.daily. It should be there.

/etc/cron.daily$ ls *loc*    
  • sure but crontab -e doesn't show me a line that does updatedb. How do I access that? Not to meddle with it but to see what its all about? – dearN Oct 20 '12 at 15:08
  • 1
    Why would it be in crontab -e? That's old skool ;) daily events should go into /etc/daily – Rinzwind Oct 20 '12 at 15:27
  • 1
    I checked and my system doesn't have a file or folder called daily under /etc – dearN Oct 20 '12 at 16:52
  • @drn cron.daily and its a directory. – Rinzwind Oct 20 '12 at 18:13
  • 1
    For others that find this, you're probably looking to edit /etc/cron.daily/mlocate.cron, and specifically this line in it that calls updatedb: /usr/bin/updatedb -f "$nodevs" – kevinmicke Sep 17 '17 at 19:03

In addition to Rinzwind answer

updatedb is usually run daily by cron(8) to update the default database.

Now back to your demand:

if you want to run updatedb on startup

you can use cron for this job, run the command:

sudo crontab -e

Add the following:

@reboot /usr/bin/updatedb

Save and exit.

Now this ensures that you'll update the mlocatedb on every startup of your system, in addition to its scheduled everyday.

You can comment the line containing mlocate in /etc/cron.daily to stop the usual schedule everyday.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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