Jump to content

Search for files on a connected server?


Recommended Posts

Hi,

 

I have only just discovered Alfred, and hence the below could just be that I am missing something? I just want to be able to find files / folders on a connected server? I've looked around and found the workflow for connecting a server, but how do actually search it?

 

Thanks

 

Soon to be embarrassed user!

Link to comment

Hi,

 

I have only just discovered Alfred, and hence the below could just be that I am missing something? I just want to be able to find files / folders on a connected server? I've looked around and found the workflow for connecting a server, but how do actually search it?

 

Thanks

 

Soon to be embarrassed user!

 

On remote connected servers, Alfred doesn't search these by default. Alfred relies on metadata generated by Spotlight. That being said, if the drive isn't indexed by Spotlight, Alfred can't search it either. So, in order to search remote servers, you would have to get Spotlight to index it, and then add it to Alfred's scope.

sudo mdutil -E /path_to_volume

The command above allows you to enable indexing on the specified volume.

Link to comment

Hi,

 

I had a crack at this, but i'm pretty sure I haven't done it correctly? I have never used Terminal before, so this is all a bit scary  :D

 

 

sudo mdutil -E/volumes/192.168.*.***/graphics server/
Password:
mdutil: invalid option -- /
Usage: mdutil -pEsa -i (on|off) -d volume ...
Utility to manage Spotlight indexes.
-p             Publish metadata.
-i (on|off)    Turn indexing on or off.
-d             Disable Spotlight activity for volume (re-enable using -i on).
-E             Erase and rebuild index.
-s             Print indexing status.
-a             Apply command to all volumes.
-V vol         Apply command to all stores on the specified volume.
-v             Display verbose information.
NOTE: Run as owner for network homes, otherwise run as root.
 
How do I know if it is now indexing or not?
 
Thanks
Edited by grantsmith
Link to comment

You might have more options depending on what kind of server the remote files are on. You might be able to tap into native search utilities there or use the "locate" command from command line, although, this might mean that you'd need to update the database each time, which has a funky command in OSX (it isn't just "updatedb" like it is on most linux systems).

 

For instance, you could write something that would go to the base directory and run "ls -RAl" and then parse the output for you. It depends on the directory structure as to the amount of output that you get, so, that might be intense. That command lists the directory recursively with each item on a single line.

 

Here is example output from part of a directory in a drupal installation:

 

./sites/topos/themes/garland:
total 104
drwxr-xr-x 2 www-data root  4096 Sep  9 23:22 color
-rw-r--r-- 1 www-data root   814 Aug  7 22:04 comment.tpl.php
-rw-r--r-- 1 www-data root  1320 Aug  7 22:04 fix-ie.css
-rw-r--r-- 1 www-data root  1162 Aug  7 22:04 fix-ie-rtl.css
-rw-r--r-- 1 www-data root   409 Aug  7 22:17 garland.info
drwxr-xr-x 2 www-data root  4096 Sep  9 23:22 images
-rw-r--r-- 1 www-data root  5116 Aug  7 22:04 logo.png
-rw-r--r-- 1 www-data root  2749 Aug  7 22:04 maintenance-page.tpl.php
-rw-r--r-- 1 www-data root   992 Aug  7 22:04 node.tpl.php
-rw-r--r-- 1 www-data root  2914 Aug  7 22:04 page.tpl.php
-rw-r--r-- 1 www-data root  1047 Aug  7 22:04 print.css
-rw-r--r-- 1 www-data root 10950 Aug  7 22:04 screenshot.png
-rw-r--r-- 1 www-data root 20786 Aug  7 22:04 style.css
-rw-r--r-- 1 www-data root  4967 Aug  7 22:04 style-rtl.css
-rw-r--r-- 1 www-data root  4451 Aug  7 22:04 template.php
-rw-r--r-- 1 www-data root   753 Aug  7 22:04 theme-settings.php


./sites/topos/themes/garland/color:
total 48
-rw-r--r-- 1 www-data root 20894 Aug  7 22:04 base.png
-rw-r--r-- 1 www-data root  5959 Aug  7 22:04 color.inc
-rw-r--r-- 1 www-data root   922 Aug  7 22:04 preview.css
-rw-r--r-- 1 www-data root  9965 Aug  7 22:04 preview.png

You could parse those well enough with a few regular expressions.

 

If you're really ambitious, then you could always create something that would index the filename on the server and then cache it in a sqlite3 database. You'd have to manually update the database (although, if you're using something that reacts to events, then you could have this run each time the drive connects). If you cache it in a database, then the search would take less time.

 

Or, there might be other tools that do these things already that I don't know about.

 

I know that this might seem intimidating for someone who isn't as familiar with the terminal, but it might be a good project to do to learn more.

 

Shawn

Link to comment

Hi, thanks for the reply, but you have totally lost me! I'm not coder, developer or anything like that, nor am I sure I want to to be!

 

I just want to be able to use the software I brought to search the Mac OS 10.7 sever I use on a daily basis to do my job.

 

I do appreciate the replies, but I still can not actually use the software in the way I was hoping it would help me.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...