On a new Ubuntu 10.4 instance, I tried to use the locate
command only to receive the error
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
from using this command on other systems I'm guessing that this means the database has not yet been built (it is a fresh install). I believe it is supposed to run daily, but how would I queue it up to run immediately?
Also, how is "run daily" determined? If I have a box that I only turn on for an hour at a time will the database ever be built on it's own?
Best Answer
The cron job is defined in
/etc/cron.daily/mlocate
.To run it immediately:
or better
This is better because
updatedb
is set in the Idle I/O scheduling class, so that it do not disturb (from the I/O point of view) other applications. Fromionice
man page: