LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-26-2010, 05:05 PM   #1
JoeyB
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Rep: Reputation: 0
2 Databases with locate and updatedb


Hello All,

I have updatedb running daily to do the traditional indexing of files so you can type in locate filename and find out where those exist. I figured out how to restrict what paths are being searched, but now I would like to create an alternate DB so that when I type in locate it uses the default index file, but if I pass a parameter to locate it uses the alternate db I want to make.

So I want the 2nd index file to contain lets say only files in /home/BACKUP then lets say build the data file called backup so I would execute:
locate -d path/backup(db) which will search these seperate files.

So again, how do I config updatedb.conf when it already has this:
PRUNEFS = "auto afs iso9660 sfs udf"
PRUNEPATHS = "/afs /media /net /sfs /tmp /udev /var/spool/cups /var/spool/squid /var/tmp"

for the default file vs the additional backup file.
And how do i add it to run daily as well?

Any help appreciated Thanks!

Joey
 
Old 05-27-2010, 05:59 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Updatedb has an option ( --output=dbfile ) for which the default is /var/lib/locatedb. That would serve for the traditional locate command. By changing the dbfile name, you can create an alternate db.

Locate has an option ( --database=path ) which you can use to specify the path to the alternate db you created with updatedb.

Put both commands into a simple shell script to run consecutively, with an appropriate sleep or wait command between them. Then set a crontab to run the script daily.

See the man pages for locate and updatedb for more information. Also, www.google.com/linux is your friend. You may find more info via that route as well.

Last edited by bigrigdriver; 05-27-2010 at 06:04 PM.
 
  


Reply



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
locate updatedb konfigure Mandriva 3 02-03-2008 09:50 PM
locate & updatedb Wicus001 Linux - Software 2 09-27-2007 05:39 AM
updatedb / locate doesn't appear to work allelopath Linux - Software 5 08-28-2005 10:55 PM
Frontend for Updatedb and Locate? tbeehler Linux - Software 4 02-13-2004 10:07 AM
updatedb/locate difficulty UB_KMA Linux - General 4 12-29-2002 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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