LinuxQuestions.org
Review your favorite Linux distribution.
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 12-20-2004, 07:18 PM   #1
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Rep: Reputation: 30
my locate command says database is more than 8days old


Dear all,

I tried to use locate to search for a file, but the following replied came out:

warning: locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old

When I "man locate" it took me to the manual page of "slocate" and so I tried slocate to search for the file bu the same result came out.

I can use find -name xxx -print to search for files but its sometimes not qutie effective and slow.

any one knows the problem please correct me,

Thanks in advance
 
Old 12-20-2004, 07:25 PM   #2
drj000
Member
 
Registered: Sep 2004
Location: Hagerstown, MD
Distribution: Ubuntu Natty Narwahl
Posts: 258

Rep: Reputation: 31
Re: my locate command says database is more than 8days old

Quote:
Originally posted by Niceman2005
I tried to use locate to search for a file, but the following replied came out:

warning: locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old
Run updatedb as root.
I've created a cron job to run updatedb every twelve hours, so I never have a problem with an out-of-date database. You might consider doing something like that if you use locate frequently, and frequently install new programs/download stuff.
 
Old 12-21-2004, 08:03 AM   #3
whipermr5
Member
 
Registered: Dec 2004
Location: Singapore
Distribution: Fedora Core 5 Linux
Posts: 202

Rep: Reputation: 30
You must update the database which locate searches to find your files. Run updatedb to do this. It may take quite a while
 
Old 12-21-2004, 07:15 PM   #4
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Original Poster
Rep: Reputation: 30
Thanks
whipermr5 and drj000

Although I don't quite understand why but it worked, thank you very much for helping.
 
Old 12-21-2004, 07:28 PM   #5
drj000
Member
 
Registered: Sep 2004
Location: Hagerstown, MD
Distribution: Ubuntu Natty Narwahl
Posts: 258

Rep: Reputation: 31
Quote:
Originally posted by Niceman2005
Although I don't quite understand why but it worked, thank you very much for helping.
As I understand it, the locate doesn't actually search your hard-drive, but instead searches a database of all the files on your hard drive. If that database isn't kept up-to-date, it won't display accurate results, so occasionally you have to update that database by running updatedb.
 
Old 12-21-2004, 07:36 PM   #6
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Original Poster
Rep: Reputation: 30
Ohooook,

thank you veyr much drj000!
 
Old 01-04-2005, 01:25 PM   #7
Andramalech
Member
 
Registered: Nov 2004
Location: Sweden
Distribution: SUSE 11.2
Posts: 52

Rep: Reputation: 15
Re: Re: my locate command says database is more than 8days old

Quote:
Originally posted by drj000
I've created a cron job to run updatedb every twelve hours, so I never have a problem with an out-of-date database. You might consider doing something like that if you use locate frequently, and frequently install new programs/download stuff.
can anybody give any tips on how to do something of this sort?
 
Old 01-04-2005, 05:55 PM   #8
drj000
Member
 
Registered: Sep 2004
Location: Hagerstown, MD
Distribution: Ubuntu Natty Narwahl
Posts: 258

Rep: Reputation: 31
Re: Re: Re: my locate command says database is more than 8days old

Quote:
Originally posted by Andramalech
can anybody give any tips on how to do something of this sort?
For me, I have it run at 6am and 6pm, so to do that, in the file /var/spool/cron/root, it says
Code:
0 6,18 * * *	updatedb
However, I don't edit the file manually. I just run kcron as root to set it up for me.
 
  


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
how to configure updatedb to update locate database manually septanla Linux - General 4 12-22-2010 03:05 PM
updating locate database only when disk activity low beetlenaut Linux - Software 1 11-23-2004 07:26 PM
How to use locate command MartinOG Linux - Newbie 3 06-07-2004 02:59 PM
using locate command stabu Linux - Newbie 6 03-26-2004 05:13 AM
database and locate mikeshn Linux - General 1 01-19-2004 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:43 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