Automator: Backup, Encrypt and Move to iDisk
Offsite storage is an excellent and some would rightly argue an essential piece of any sound backup strategy. Because of the limitations (cost, disk space, bandwidth) involved with an offsite, online backup, you would probably want to limit it to just really essential data that you simply could not afford to lose. You can backup everything locally, and chose a small subset of photos, documents, etc. to send off to offsite storage on a regular basis.
Now that the iDisk space has been increased to 10GB, it is a little more useful as backup storage (if you have a .Mac account that is). The downside to offiste storage is that it is usually completely out of your control so if you have sensitive data you would want to encrypt it before sending it off.I’ve created an automator action that will Archive (create a .zip) of a folder of your choosing. For mine I chose my Journler Data folder but it could any folder that contains data that is important to you. Then encrypt that Archive with gpg, and send the resulting encrypted zip to iDisk.Since this automator action is dependent on GPG it must be installed on your Mac first. There are plenty of great tutorials for installing GPG on a Mac. This is only one.The first step is to select Get Specified Finder Items. Here you select the folder you want to backup. Then you add a “Create Archive” step to the workflow. Chose a name for your archive and a location. I chose the Desktop. All other steps assume the Archive is on the desktop, so if you change it alter paths and such accordinglyOnce the archive is created we encrypt it with GPG.Add a shell script step to the workflow.Mine is below:
/usr/local/bin/gpg -r <e-mail address you used for your gpg key> –yes –batch –trust-model always -o /Users/sean/Desktop/JournlerBackup.zip.gpg –encrypt /Users/sean/Desktop/JournlerBackup.zip
Next you’ll need to mount your iDisk. Bafflingly there’s no Automator action to do this. So we’ll need to add a “Run AppleScript” step.The AppleScript to mount iDisk is as follows:
tell application “Finder”
mount volume ¬
“http://idisk.mac.com/USERNAME/” as user name “USERNAME” with password “PASSWORD”
end tell
Then a simple “Get Specified Finder Items” where you select the name of your GPG encrypted zip archive. In this example it is: JournlerBackup.zip.gpg And a “Move Finder Items” where you select the destination. Mount your iDisk while writing the Workflow so it will be available to browse when you configure this option. Unmount before writing the script otherwise, your AppleScript will get an error since the drive is mounted and stop the workflow. You will also want to check the “Replace Existing Files” option so you can overwrite any old backups of the same Archive already on your iDisk, unless you want to keep a few versions of the backup.
And that’s it!
For extra points you could add some cleanup to the end like deleting the local zip and unmounting the iDisk.