Time Machine: Backup to Fileshare Over SSH

Time Machine is one of OS X 10.5's newest feature that simplifies backing up of data by simply designating a hard drive as the destination and turning it on. It's been already been demonstrated that it's also possible to use a Leopard-based fileshare as a backup destination with Time Machine gracefully mounting and dismounting the share as needed.

For those users who are on laptops or possibly wish to backup to an offsite location, it's also possible if you tunnel your AFP (Apple File Sharing) connection through an SSH tunnel.

Here's how to do it...

On the destination Mac (referred to as "desktop"), set up your share (referred to as "TM") that the source Mac (referred to as "laptop") will back up to. Set permissions on the share as needed (I'm currently using Everyone/Read&Write) and make sure that you have sufficient space available to store the backups.

On the source Mac, mount the TM share and point Time Machine to this share. Add the necessary excluded sources and let the initial backup complete. Confirm that subsequent backups are running smoothly by running Time Machine and browsing the backups.

Once that all seems to be in working order, the next step will be to take your laptop offsite to test remote backup. Make sure that Remote Login (SSH) is enabled on your desktop before leaving your local network.

From your offsite location, begin the process by setting up an SSH tunnel in Terminal to your desktop (typically, that would looks something like this):

ssh -L 10548:localhost:548 your.desktop.ipaddress (or hostname)

Once the tunnel is up, connect to the remote share with the "Connect to Server..." command (Finder/Go/Connect to Server...) and use the following server location:

afp://127.0.0.1:10548/TM

at which you may be prompted to authenticate. Go ahead and authenticate and the TM share will mount. If you've missed a Time Machine backup, it should detect the presence of the share, mount the backup image volume, and automatically begin the backup. Alternatively, you can run Time Machine to browse your backups.

Comments

hey, great tip on Time Machine

Thanks for putting this up. Will have to try it out!

Post new comment

The content of this field is kept private and will not be shown publicly.