Requirements
- A working computer with plenty of harddisk space. I have 1TB at my disposal in this article.
- AFP pre-installed on that computer. If you’re doing this on Mac OSX just enable file sharing and you’re set.
- A (fast) working LAN.
- Basic skills with Mac OS X regarding installing software and using finder. Knowledge of Automator and iCal is a bonus but not required.
What does this exactly do when it’s working?
This method creates a full backup or copy from your home folder of your mac to a remote location.
Every time you run the workflow it checks for new and updated files and copies those to the remote location. It also checks for deleted files and removes those from the server. So basically it keeps 2 locations in sync.
Motivations
Why not use Time Machine in Leopard? It’s too limited to my taste. I don’t want hourly/daily/weekly backups. Plus Leopard requires an Xserve or Xsan for networked backups.
But why run a server? I have a Networked harddisk… That will do just fine if it supports AFP
Setting up Mac OS X (Tiger/Leopard)
Install RsyncX which can be downloaded here.
Creating a workflow
Now to create a little application to make the backup for you. This is not very hard and can be done with Automator (included in OS X) and a little Shell script utilizing RsyncX.
Open /Applications/Automator and create the following workflow. I want it to ask permission before actually doing anything and i want it to show a growl popup when it starts and finishes. Also we need to connect to the server/share.
In Automator, look for the ‘actions’ on the left and drag them to the wider column on the right. Make sure you use the right order and follow the directions below. Ofcourse you can leave certain things out or add extra actions if you wish. That is up to you!
We start with asking for permission:

Next we look up which server/device we connect to:

Make sure you add the right server and in the server path also put the share to where you make the backup. So in the image my share is ‘Arnan’
Now we know where to go to we can connect to it. This is done in the next action:

We’re connected now, i would like to show this in a Growl notification and announce the start of the actual backup:

Of course change the text to your liking or skip this action all-together if you want.
At this point we’re ready to start the actual backup. Automator cannot do this on it’s own, so we allow it to run a shell script:

This is the shell script i use in the action:
/usr/local/bin/rsync -avz --update --delete \ --exclude "Downloads/" \ --exclude ".Trash/" \ --exclude "Library/Caches/" \ --exclude "Movies/" \ ~/ "/Volumes/Arnan/Back-up"
Explanation of the different pieces…
We start RsyncX with this part:
/usr/local/bin/rsync
We tell it what to do here:
-avz --update --delete
-avz means archived verbose compressed. This saves bandwidth and shows what its doing (verbose mode). –update only copies newer files than those that are on the server already and –delete deletes any file that is on the server but not on the computer (sync)
Next we exclude several parts (this can be skipped):
--exclude "Downloads/" \ --exclude ".Trash/" \ --exclude "Library/Caches/" \ --exclude "Movies/" \
In this case. I choose these folders as they either are not interresting enough to back up or are temporary files anyway or very large files i have elsewhere stored. So i can exclude them savely.
And lastly we tell RsyncX what folder to backup and where it’s going:
~/ "/Volumes/Arnan/Back-up"
~/ is your home folder and “/Volumes/Arnan/Back-up” is the server share we send it to. Since it’s an AFP mount it’s seen as a regular harddisk /Volumes/ the share name Arnan/ and the backup folder Back-up/
Once the workflow is all set up. Save it as a workflow for later reference (if you want/need to change something) and then save it again (file > save as) as an application. This file will be an .app and should be used to make the actual back up.
Planning your backups
Set up to your needs. I have the repeat set up to run every Sunday at 9PM

You can also skip this step and run the backup manually of course…
Another option is to add the workflow to your login items so it makes a backup every time you log in to your Mac. Or whatever you prefer!
Retrieving files from the backup
Go into finder and press command-k. Or go to the menu Go and click ‘connect to server’.
A connect dialog should appear

Fill in the IP-address/hostname of your backup server.
Next it should show a login prompt. Fill in the Username and Password of your backup server account (the user you have on the server)
Then OS X should mount the backup in finder for you to access. Note that system folders are degraded to normal folders. So you should take the contents of those and copy it to the Local system in order to properly retrieve the files. If you overwrite the folders (Pictures, Movies, Documents, Desktop and the like) i’m not sure what happens but i assume it’s not healthy for your system since they have special icons and functions for certain applications.
Also be careful with retrieving the Library folder. Placing the complete thing back might do more harm than good. In my experience it’s better to dive into that thing and just retrieve the few files you need rather than just copy it 1-on-1 to the local system.
Have fun!



by Neil
17 Feb 2009 at 15:39
Great article though I’m surprised there’s no commercial solution that can backup AFP volumes.