LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   regarding "locate" command... (https://www.linuxquestions.org/questions/linux-newbie-8/regarding-locate-command-275932/)

zameer_india 01-09-2005 11:29 PM

regarding "locate" command...
 
Hi All...
Good Morning ...

When i am trying to locate a file xxxxx from a terminal i got a message like "database /var/lib/slocate/slocate.db' is more than 8 days old" .... i am not able to recognise a problem...

any help would be appreciate....
infact this is the process done so far

[root@redhat zam1]# locate Teradata.pdf
warning: locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old
[root@redhat zam1]#

i run "find " command successfullly.... but it takes a long time for searching.... any help would be appreciated...

thnx in Advance...
zameer ahmed syed.

wapcaplet 01-09-2005 11:39 PM

The way 'locate' works is to use a searchable database of the files on your computer - that's how it works so fast. But you have to keep the database up-to-date. To do that, run 'updatedb' as root. To make this happen automatically, you can put a script in /etc/cron.daily that looks like:

Code:

#!/bin/sh
updatedb

Make sure it's executable (chmod +x /etc/cron.daily/updatedb) and it should be run automatically once a day to keep you up to date.

zameer_india 01-10-2005 12:11 AM

Thanx Wapcaplet...

U done a gr8 help for me.....now its working fine .... I am having negligible knowledge in script...if u don't mind could you plz tell me how to make it autoupdate (using script) step by step..

iam assumeing like this
i have to make a txt file and write the script which u gave....
then i have to save in which file ????...

ThnQ.....
zameer

wapcaplet 01-10-2005 07:16 AM

Quote:

Originally posted by zameer_india
i have to make a txt file and write the script which u gave....
then i have to save in which file ????...
You can call it anything you like, as long as you save it in the /etc/cron.daily direcctory; saving it as /etc/cron.daily/updatedb would be appropriate.

zameer_india 01-10-2005 07:55 AM

THANX WAPCAPLET....

titanium_geek 01-10-2005 08:58 AM

you know, cron was one of the things I struggled with a couple of years ago. Gave up. This looks way easier.

THANKS WAPCAPLET!

titanium_geek


All times are GMT -5. The time now is 11:21 AM.