[rhn-users] "search for files" problem

Knutsen, Mark Mark.Knutsen at nasdaq.com
Mon Aug 9 13:17:30 UTC 2004


The locate database can easily get out of date on a laptop that you
don't
use for many minutes at at time, because the daily cron (or anacron) job
doesn't get to run. Is the machine in question a laptop or desktop that
is
usually turned off?

Other general tips for figuring out how stuff works:

  rpm -qif `which locate`   (note the backticks)

...will show a description of the package that the 'locate' command
belongs
to.

Likewise,

  rpm -qlf `which locate`

...will show all the files belonging to the package that the 'locate'
command belongs to, which often includes documentation and startup
scripts.

-----Original Message-----
From: rhn-users-bounces at redhat.com [mailto:rhn-users-bounces at redhat.com]
On Behalf Of Paul A. Kennedy
Sent: Monday, August 09, 2004 9:11 AM
To: Red Hat Network Users List
Subject: Re: [rhn-users] "search for files" problem

On Mon, Aug 09, 2004 at 06:46:23AM -0500, L J Dennis wrote:
> Tried to do a file search for the first time.  Received the error
> "Warning: Locate: Warning: '/var/lib/slocate/slocate.db' is more than
> 8 days old."  I know that this file needs to be updated in order
> to complete my search but do not know how to do this.  Can't seem
> to find any help on this.  Thanks in advance for your advice.


Hello,

I believe that your question has been mostly answered already, but I
decided to
write a little more in case someone searches the archives later.

So, you know that you should be using locate, so that's a start as to
where to
look to hunt for more information.

If I do a man on locate on my systems, I get a man page for slocate (but
not a
man page for updatedb, the command you you need).  If I do a man -k
slocate,
however, I get listings for slocate and updatedb.  This is how you might
find
information for the next time.  (Actually, I think that this is a
deficiency of
the slocate man page to not mention updatedb.)


Ideally, updatedb should be run as a cron job.  In fact,when I look:

	# grep  updatedb /etc/cron*/*
	/etc/cron.daily/slocate.cron:/usr/bin/updatedb -f
"nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,/usr/tmp,/afs,/net"


So, I suspect that you may have a larger problem.  Is the partition
where the
locate database is located full?

Anyway, hope this helps.

Paul






More information about the rhn-users mailing list