LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Why Do I need to run updatedb each time I search for a file or folder? (http://www.linuxquestions.org/questions/linux-software-2/why-do-i-need-to-run-updatedb-each-time-i-search-for-a-file-or-folder-328694/)

lennysokol 05-30-2005 09:01 PM

Why Do I need to run updatedb each time I search for a file or folder?
 
Any time I have to search for a file or folder on my Linux machine (Fedora Core 3) I have to run updatedb and then it searches the computer.

Why do I have to run this, and is there anyway to go around this? It is somewhat of a pain!

Thanks Linux community!:D
--------------------------------
Worst Speller. Proud. As Can Be.

mjrich 05-30-2005 09:53 PM

You shouldn't have to ;)

Most likely updatedb is being run once per day via crontab -- the following should tell you (this is on a Debian system, so the location of your crontab files may differ):
Code:

grep -r updatedb /etc/cron*
You can always change this so that it runs hourly (etc. etc.) or some other opportune time, though for most purposes once per day is enough.

Cheers,

mj

piratePenguin 05-30-2005 10:27 PM

You only need to use 'updatedb' if you use 'locate' or 'slocate'.
If you use 'find', which is more flexible but not as fast (because it doesn't use a database) you don't need to run 'updatedb'.
Check 'man find' if you like.

MS3FGX 05-30-2005 10:40 PM

I know on Slackware it runs updatedb at 12 AM, so sometimes my laptop doesn't get it's DB updated for weeks simply because it isn't on when it is scheduled to update the DB.

lennysokol 05-30-2005 10:49 PM

Thank You.


All times are GMT -5. The time now is 01:32 PM.