LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-10-2005, 12:29 AM   #1
zameer_india
Member
 
Registered: Sep 2004
Location: hyderabad
Posts: 210

Rep: Reputation: 30
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.
 
Old 01-10-2005, 12:39 AM   #2
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
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.
 
Old 01-10-2005, 01:11 AM   #3
zameer_india
Member
 
Registered: Sep 2004
Location: hyderabad
Posts: 210

Original Poster
Rep: Reputation: 30
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
 
Old 01-10-2005, 08:16 AM   #4
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
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.
 
Old 01-10-2005, 08:55 AM   #5
zameer_india
Member
 
Registered: Sep 2004
Location: hyderabad
Posts: 210

Original Poster
Rep: Reputation: 30
THANX WAPCAPLET....
 
Old 01-10-2005, 09:58 AM   #6
titanium_geek
Senior Member
 
Registered: May 2002
Location: Melbourne Australia
Distribution: it died/ macosx
Posts: 2,478

Rep: Reputation: 50
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 08:42 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 04:28 PM
A few annoying problems; Cannot locate theme & "No DFP detected". Ninja Cow Slackware 0 04-29-2004 01:01 AM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-22-2003 12:47 AM
Can't locate object method "splitpath" via package "File::Spec" RobJohnston Linux - General 2 06-28-2003 10:59 AM


All times are GMT -5. The time now is 06:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration