Apple Automator For the Win!

In: Technology

13 Dec 2009

One drawback of not getting an HP Home Server is that it doesn’t do Apple Time Machine compatible backups, so my Macs don’t automatically back up. Most of what I do on my Mac is web based or using applications that are working with files already stored on my network.

The big exception to that is my Lightroom collection of photos. That’s all on the 24” iMac’s external Hard Disk.

I did have a completely manual workflow where I would copy the entire library to the external drive on my HP desktop to have a backup copy. When I added a second 1TB drive to the Windows Home Server I decided to start backing that external up also.

With that drive’s image of my Lightroom Gallery being backed up daily, I got to thinking “how can I keep that secondary copy of the photos up to date so the backup is truly automatic?”

It turns it out’s alot more simple than I thought and requires no 3rd party software to install at all. The magic is done through two applications that come on every Apple Mac..Automator and iCal.

Automator

If you have never used this little gem, it’s totally fantastic. It allows you to create complex workflows, save them as applications, scripts, and even attach them to folders to run automatically. In my case I wanted to create an application so I can schedule it. The process looks something like this.

automator

If you look at the library of actions you see instantly that this tool can automate pretty much anything. In this case we only care about connecting to a server, and copying some files. We use four modules to accomplish this:

Get Specified Servers

This action tells the script what server you want to use. In this case I am using SMB to connect to a Windows Network Resource and if you notice the url, I am specifying the username and password so I don’t get prompted to enter it when the workflow runs.

Connect to Servers

The connect to server action simply establishes the connection we detailed in the Get Specified Servers action.

Get Specified Finder Items

This action is identifying which files and folders we want to act upon. If you notice in the image I am defining my Lightroom Collections folder on my external hard drive. This will capture both the image files and the lightroom catalogs.

Copy Finder Items

The last action just takes the files and folders I specified, and copies them to the destination location which is the network share I connected to in the first action.

After we save this as an application, it’s ready to go. Save it somewhere that you want it to run from, and now we can schedule it.

iCal

You might think we need something super complex to schedule this thing to run. The truth is iCal can do it all. It’s really easy too.

iCal

If you look at the recurring appointment I created, I have added a setting to make this Automator application run whenever the event is triggered.

It’s really that easy.

I have uploaded the script in case you want to try to do this yourself, you can download it here.

2 Responses to Apple Automator For the Win!

Avatar

Arnan

December 13th, 2009 at 2:28 pm

Keep in mind though that while this might work fine in most cases. The workflows making use of finder, like the one you made here, tend to lock up finder during the process. IE, making finder stall other tasks until the copying has completed. Atleast in OS 10.5 this was the case. I haven’t tested this on OS 10.6 yet.

Did you notice this? If so, the sollution is rather ’simple’ you can use automator but instead of using it to have finder connect to your server have it run a shell script which would be a rsync command to copy your files.

Avatar

Jason Burns

December 13th, 2009 at 3:42 pm

Yea, there is that. But this is part of my nightly backup process, so the assumption is that I am not using the machine when this runs.

Comment Form

About this blog

Jason Burns is a technology enthusiast, Microsoft guy, photographer, musician and all around geek. This blog is the general rambling one, check out the links for the specific ones!

Photostream

    IMG_4086Haggie Likes It!IMG_4081IMG_4080Mione's new CollarIMG_3449IMG_3451IMG_3452IMG_3459
Jason Burns

Create Your Badge