OSX: Automagically creating a list of the files/folders on external hard drives, to see what's on them when they're disconnected

1

I want to be able to see a list of the files and folders on my external hard drives, without having to plug them in first.

A program that scans external drives when they're plugged in and keeps a list of their contents locally would be great, although I imagine there's a solution here involving aliases - but how to create so many aliases at once?

The use case for this would be, say I wanted to watch Cloverfield, which I know is on one of my 3 external drives, but I don't know which. I could just check my 'local list' to see which external hard drive it's on, and plug that one straight in and grab the film.

Jonni

Posted 2011-08-02T15:54:01.087

Reputation: 21

How would your local list look like? A simple text file? – slhck – 2011-08-02T16:01:19.157

Answers

2

This would be pretty easy to do on Linux.
The real question is... how do you trigger a script to run from OSX's automount.

That.. I don't know..

Once you figure that part out you can use something like this:

#!/bin/bash
$DRIVENAME = $1
find /mnt/$DRIVENAME > /myLists/$DRIVENAME

user606723

Posted 2011-08-02T15:54:01.087

Reputation: 1 217

add a -aR and you are good. – Nicholi – 2011-08-02T16:47:58.540

Well, the **/* uses globbing to recurse. Which then has ls print out the full path of the file in question. There are most certainly other ways to do it though.. – user606723 – 2011-08-02T16:56:54.540

1Correct, but it won't include hidden files and will not go further than 2 directories deep. – Nicholi – 2011-08-02T17:02:39.290

Whoa, you're right. How did I never notice that. Edited. – user606723 – 2011-08-02T17:06:35.157

Aye, find would be another acceptable alternative imho. – Nicholi – 2011-08-02T17:11:21.233

0

You can easily create an AppleScript that recurses through a folder (in your case, the root HDD) and writes all files to a text file. There are plenty of such scripts out there if you don't want to write on your own (here's one).

Traveling Tech Guy

Posted 2011-08-02T15:54:01.087

Reputation: 8 743