LinuxQuestions.org
Help answer threads with 0 replies.
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 08-28-2007, 05:52 AM   #1
msz59
LQ Newbie
 
Registered: Aug 2007
Posts: 3

Rep: Reputation: 0
merging slocate databases - how?


Is it possible to merge slocate databases built on several machines in a local network? Typically, updatedb omits network-mounted directories when building/updating the database, otherwise it could go forever. Still, it might be useful to have a tool to construct a merged database built up from two or more local slocate databases and be able to search files located anywhere in the LAN, just in a single pass, without repeating the search on every machine.

regards, Michal.
 
Old 08-28-2007, 06:06 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i wouldn't look to merge databases, but use each database in turn... you could easily store the databases on a common NFS location and the cycle through them with a simple bash loop. that also let's you add in extra details about what machine it is on, which isn't held within the database. alternatively you could leave all databases untouched and use a framwork of ssh to connection into each machine and run the searches remotely and just give you back the data. this would X number of machines search a singel database, rather than a single machine search X number of databases, so will be faster by a factor of X.

Last edited by acid_kewpie; 08-28-2007 at 06:11 AM.
 
Old 08-28-2007, 06:16 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Code:
LOCATE_PATH=/var/cache/locate/locatedb:/server1/var/cache/locate/locatedb locate blabla
 
Old 09-18-2007, 01:28 AM   #4
msz59
LQ Newbie
 
Registered: Aug 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the hints. Still, there is a problem.

I arranged copying (in /etc/crontab) individual slocate.db files from several machines to one location on the main server, with appropriate filename change.

When I, however, try to search the databases being logged to the main server, using "slocate -d /path/machine_name.db pattern" it shows nothing. Only when I get superuser privileges, it shows the files matching the pattern.

It seems that "slocate" run by an ordinary user checks for existence of each file matched. Surely it does not find the file on another machine.

Can this be avoided? Or the only way is to make multiple "rsh" or "ssh" calls to every machine which in turn requires the access to those machines without using password.

regards, Michal.
 
  


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
how to create automatically the /var/lib/slocate/slocate.db irhernan Linux - Newbie 3 09-12-2006 02:29 PM
sendmail and NIS databases (aliases, mail.aliases) - what kind of databases? cotton213 Linux - Software 0 03-14-2006 05:57 PM
slocate dajomu Ubuntu 1 09-16-2005 08:08 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

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

All times are GMT -5. The time now is 11:47 PM.

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