Re: Fwd: Network volume considerations when working with files?
Re: Fwd: Network volume considerations when working with files?
- Subject: Re: Fwd: Network volume considerations when working with files?
- From: Axel Luttgens <email@hidden>
- Date: Thu, 02 Aug 2007 18:04:13 +0200
On 2/08/07 2:52, Brett Conlon wrote:
This has been a blindingly hectic project so I haven't been able to much
troubleshooting but with this script it simply wouldn't produce any
results on volumes mounted over the network. If the script was run
locally
it would successfully find items.
Given the script you provided, it appears that your searches are of this
kind:
mdfind -onlyin /path/to/folder "kMDItemTextContent == 'stringtofind'"
This goes beyond searches based on file names only, and thus requires a
Spotlight database.
Without such a database, the queries would always return an empty set.
Currently, with Tiger, Spotlight is mainly a local affair: local
processes (mds, mdimport...) create and maintain the required databases
on each box. [1]
For a local volume, the database is generally located at the volume's
top level, as a folder named ".Spotlight-V100".
For a remote volume (i.e. some folder shared by a server), things are
somewhat more complicated.
Even if the volume with the shared folder has been indexed on the
server, by the server, this has been achieved by processes local to the
server.
And your computer, as a client, has just no access to that remotely
built index.
Now, one may ask the local Spotlight sytem to index the mounted volume,
with the mdutil(1) command.
Assuming the sharepoint has been mounted, for example, through AFP as:
/Volumes/PublicData,
issuing the following command on the client:
sudo mdutil -i on /Volumes/PublicData
should start the local indexation of volume "PublicData" (the Spotlight
database beeing built as a sub-folder of /var/db/Spotlight-V100/).
After a while, queries such as:
mdfind -onlyin /Volumes/PublicData "kMDItemTextContent ==
'stringtofind'"
should be operational on the client.
There are some drawbacks.
So, once the remote volume is unmounted, the local database will be out
of sync and will need to be refreshed (see mdimport(1)) or, perhaps
better [2], rebuilt at the next mount time.
The same way, the local index will be built through the lens of the user
who has mounted the volume: only the files/folders readable by that user
will be taken into accout.
HTH,
Axel
[1] It looks like that Mac OS X Server's Spotlight has the ability to
partially share its own database with client computers. That is what
mdutil's "-p" option would be for.
[2] I'm not sure, but it seems that re-using a database previously built
under /var/db/Spotlight-V100/ tends to loop.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden