photo Daniel Nisbet
Data Centre Administrator
University of Manchester: IT Services; Infrastructure & Operations

What's Occuring?

Bury Weather

Last Updated on October 13, 1:47 PM BST
11.8°C - Wind From the NE at 9.0 MPH
Rain today: 0.00 in (0.0 cm) - Pressure: 1006.3 mb

Recently written

Remote Time Machine (10 days ago)

I thought I’d write down some notes in case I ever want to come back to this.

Basically I had to do a restore from backup the other day. I had backups but they were a little dated and I wondered if there was a better way that swapping round all my disks to do a local backup.

We’ve got a pretty quick internet connection and I have some connections through work so I can play with things a bit more than most people might be able to.

I was looking at using my Raspberry Pi to act as the file server. I haven’t got around to this yet because I have better things to do than mess around with computers when I’m at home.
But I thought this is still flawed, what I really want is a remote backup and for it to be done with Time Machine, because hey – that works great!
It solves several things for me – any local external usb storage takes up valuable ports, desktop space, opportunities for other things to be stored on the drive… also, if you have a catastrophe – the disks are still on site!
What I like to do is have my work machine and my home machine and have them have backups of eachother’s files.

So here’s a solution, it’s not perfect but it does work.

Take advantage of the magic of SSH tunnels.

OK they are a bit scary on the face of it. But they get you around so many of the restrictions that the big bad scary Internet places on us.

Basically things are pretty much walled off only to work on the local network because it’s known and safe(r), yeah that’s another story but run with me there.

So here’s the magic line:

sudo ssh hostname -l username -L 22:127.0.0.1:548

Basically, take the stuff that goes through port 548 that’s on the ‘hostname’ server and use the localhost port 22 address for it instead.

Port 548 is for AFP/Apple Filing Protocol and is basically what Time Machine likes for doing its stuff on a network.

 

The Server End

Once you’ve got this round your head, you can set up your file server. I was just testing this out so I fired up an Ubuntu VM and followed this article.

Note in scope here: Being able to access your server from your home network. You need something that’s publically accessible really.

Time Machine

To get it to work on your Mac, make sure your magic SSH tunnel is in place, check you can mount the network drive by pointing at afp://127.0.0.1:22, get your password right etc. Then go into Time Machine preferences and add the disk.

Boom you are done, or you’d think right?

Turns out there’s a little more. Now you are doing something odd, Time Machine doesn’t expect you to be mounting an AFP share through a weird port so when it stores the password to access it in future it doesn’t quite store the correct address to use. So you need to go into Keychain Access and under the System Keychain you’ll see a Time Machine Password, just edit the “Where” field in there to include “:22″ at the end of the URL and when Time Machine next runs it’ll run over the Internet to your share.

 

Bonus HFS+ Round

Follow steps 2 and 3 on this page to use the drive attached to your VM on a HFS+ partition, that way if you ever have to restore just bring the drive home and it’ll be so much quicker as you can mount the drive locally rather than wait for all those bits to move over the series of tubes.

Recently Heard

The Who - I'm Free 1 day ago on last.fm


Top 10 albums in the last 3 months:


Recently rated on imdb:


See
more

Pictures

dnisbet's items

Me elsewhere

Friends & Contacts

About Me