LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 09-11-2006, 09:59 PM   #1
irhernan
LQ Newbie
 
Registered: May 2006
Location: Philippines
Distribution: RedHat
Posts: 7

Rep: Reputation: 0
how to create automatically the /var/lib/slocate/slocate.db


Hi all,

When I want to locate some files, i am always prompted with the following:

"warning: locate: could not open database: /var/lib/slocate/slocate.db : no such file or directory

warning: you need to run the 'updatedb' command (as root) to create the database. "

Please advise on how to set the system so that the slocate.db is always created/updated.

TIA,

Mike
 
Old 09-11-2006, 10:04 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You can create the file /etc/cron.daily/slocate with the following permissions:
Code:
-rwxr-xr-x 1 root root 50 2006-04-19 14:56 /etc/cron.daily/slocate
and with the following content:
Code:
#!/bin/sh
/usr/bin/updatedb -c /etc/updatedb.conf
You may need to modify the location of updatedb for your system. I'm also assuming that you have /etc/updatedb.conf on your system and that it points to /var/lib/slocate/slocate.db...
 
Old 09-12-2006, 01:47 AM   #3
irhernan
LQ Newbie
 
Registered: May 2006
Location: Philippines
Distribution: RedHat
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Gilead,

Many thanks for the advice...

Cheers!

Mike
 
Old 09-12-2006, 02:29 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
No problem - please post back if you have any problems

Also, you can use the find command - it's much slower but allows a more configurable search.
 
  


Reply

Tags
locate, updatedb



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

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

All times are GMT -5. The time now is 11:39 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
Open Source Consulting | Domain Registration