29 Jul 2009

Automatically Sync a Flash Drive with a Folder in OSX

I have a WDTV media player under my TV to which I have connected a external hard drive and a flash drive. The large drive stores all my movies which I have backed up, and the flash drive is used for everyday things like TV shows. Over the last few weeks I have been looking for a solution so that when I plug my flash drive into my MacBook, it automatically syncs with a folder on the computer. I would have thought this would be a simple process, but apparently not.

Here is my solution. While not particularly elegant, it does the job, and hopefully it will help you out too.

Before you start, you need to get two quick downloads: Do Something When; a system preference which takes an action when something happens in the operating system, and SimpleSync; which (obviously) does the syncing bit. You then need to install these.

Next up you need to set up a folder to hold your media files. I chose to set up a folder called Flash TV in my movie folder, and made a shortcut on the desktop, and in the sidebar in Finder. If you are anything like me, you are going to be using this folder a lot, so you want to make it easy to get to.

I then plugged in the flash drive and ran SimpleSync for the first time. I quickly set the source and the destination, and checked the boxes to delete backup files, and auto run.

Finally you need to set up Do Something When, which shows up as DSW in your preferences panel. I created two processes. The first was Flash TV, which opens SimpleSync when my flash drive mounts. The second dismounts my flash drive when SimpleSync closes. You must remember to start DSW, and have it automatically start at log-on too.

As a result of this work, when I plug in my flash drive, SimpleSync loads and syncs the folder and drive. I then hit Command Q and the app closes and automatically dismounts the drive.

I suspect there is a way to do this in a single app but for the life of me, I can't find one. Let me know in the comments if you have a better way of doing this on a Mac.