Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-17-2004, 11:36 PM   #1
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Question When was slocate database updated?

How can I tell when my slocate database was last updated? It looks like cron should be doing it every day but I've done it manually several times when I got a warning that it hadn't been updated for several days. Thanks!
Old 07-17-2004, 11:38 PM   #2
Registered: Jun 2003
Location: Tampa, Fl
Distribution: Gentoo, Slackware
Posts: 828

Rep: Reputation: 39
look in etc/cron.*

Old 07-18-2004, 08:12 PM   #3
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
Look in /etc/cron* for... what? Everything is set up with cron, /etc/cron.daily is supposed to update slocate and the crontab looks at those files. However, as I stated above, that doesn't seem to be working, so I want to know how I can see when the database was last updated.
Old 07-18-2004, 08:48 PM   #4
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Ok, check out the contents of /etc/crontab. That will tell you exactly when the contents of cron.daily are executed. For example, my crontab file has this entry for cron.daily (Red Hat 8):
02 4 * * * root run-parts /etc/cron.daily
That's saying that everything in the cron.daily directory gets executed at 4:02 AM every day. If your computer is not turned on at 4:02 AM, then cron will miss that opportunity to run the jobs. So, if you're in the habit of turning off your computer before going to sleep, then it will never get run, and consequently give you the "out of date" message for the database. The solution would be to add the updatedb command to your startup sequence (which might add a significant amount of time to boot), run it manually, or change the time the cron.daily updates are run to sometime you know the machine will be on.

If you're really only after the last time the database was updated, you can check its modification time. On my system, it's located at /var/lib/slocate/slocate.db
Old 07-18-2004, 08:52 PM   #5
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
Ok, sorry if I didn't ask a clear question, the location of that database file was all I was after. I do realize now that the 4:00 is am, not pm, so that explains it. Thanks!


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
slocate dajomu Ubuntu 1 09-16-2005 08:08 PM
slocate error props666999 Slackware 5 11-17-2004 04:25 PM
help with slocate plan9 Slackware 8 07-10-2004 01:41 AM
Using slocate in RH 7.2 hominy Linux - Newbie 1 08-10-2003 02:59 PM
slocate foobarred Dave Campbell Linux - General 0 12-31-2001 05:35 AM > Forums > Linux Forums > Linux - Newbie

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

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