29 Oct 2010

Snow Leopard Server as a Time Capsule Replacement

Who needs a time capsule when you have Snow Leopard Server?

Nobody! Snow Leopard Server comes with everything you need to turn your Mac into a wireless backup solution using Time Machine, in exactly the same way that a time capsule would.

At this point your server should be up and running OK on your network.

Lets start by enabling remote Time Machine backups. Open up server preferences and connect to your server.

Open up the preferences for Time Machine.

We can select the disk that we want the remote backups to use. You can pick from any hard drive connected to the server. My advice would be to buy a nice big drive and use that.

Now we need to check the permissions for each user. From the main screen of server preferences select "Users" and then select the "services" tab.
We want to check that Time Machine is checked for all the users we want to be able to use it.

Simples. Now on each machine you can select your server as a backup disk from Time Machine preferences in each systems System Preferences app. Each machine then creates a sparse bundle in the Time Machine backup share which it backs up to. Thats home users sorted.

Oh but I'm not going to leave it there…

This is the Mac OS X Server Admin blog for a reason. We don't want to have to go around configuring time machine for each computer and in the end we probably can't fit all those backups on even the largest storage solution, right?

Ok so now for the fun part.

Lets fire up Server Admin and take a look at the File Sharing section.

This screen allows us to share the Root of any drive by selecting a drive and clicking "Share".
We can also use browse mode to make a share point at any point in the folder hierarchy of a drive. This means you could make Time Machine backup in the directory /Volumes/Drive/office1/backups or whatever folder scheme you choose.
So now make your share point that you'll use for some Time Machine backups. Click the share button and then switch over to the share point screen and take a look at your new share point.

Make sure Enable as a Time Machine backup destination is selected and were good to go. The warning that you see here is shown when the backup destination is a removable disk. Its perfectly compatible as long as you don't remove it!

You can see if a share point is enabled for time machine backup in the share point list by looking for the time machine icon in one of the columns



Make a note of the name of the share point you intend to use for backups. Excellent. Now we have our share points set up lets make our networked computers back themselves up automatically! Fire up Workgroup Manager and log into your server

There are a few strategies we can use here:
  • We can make a "Guest Computer" account and set that to back up to the time machine destination. This means that all computers that join your domain and don't have computer accounts in Open Directory will automatically back up. Including any random Macs that decide to join the domain.
  • We can make accounts for all the computers we have and then set Time Machine backup preferences for them individually.
  • Or finally we can set up all out computers with computer accounts, and then make a computer group and set the Time Machine preferences for the whole computer group.
I'm going to show you how to make a Guest account and then how to make a computer account, then I'll show you how to set up time machine for them automatically using open directory.

So lets start by looking at our computer accounts

Now use the Server Menu in Workgroup Manager to make a Guest Computer account. 
Bear in mind a guest computer is any computer on your domain which doesn't match up to a computer account. Think about the ramifications that this may bring if you decide to go setting preferences for it. (If you're at home think about friends bringing computers over, or at a business think about client's computers using your network.)

Alternatively create a new computer account and fill in the name section. For good measure the short name should be the name of the machine. The real info that lets a computer find its account is the hardware UUID. This can be found on each of your client Macs from "About this Mac" in the Apple menu and clicking "More Info"


Tap this in to the UUID field for the computer account in Workgroup manager and your computer account is completed.
So now select either your guest computer account or your actual computer account and have a look at the managed preferences

Specifically we want to look at the Time Machine Preferences
This is where the magic happens. From here we can manage the Time Machine preferences for the computer. The only option is to Always manage the preferences or Never manage the preferences. For info on what these mean please see Apple's documentation. 

The afp URL we type in here is the URL to the share point we made earlier. Usually it looks like this:
afp://your.server.com/Backup_sharepoint_name

afp = apple file-sharing protocol
your.server.com = domain name of your server. May not be a "proper" domain name e.g. server.local
backup_sharepoint_name = name of the sharepoint we made a backup destination earlier.

Pretty easy. The other options are all pretty self explanatory. Why would you want to back up all local volumes? In case there are other partitions with data on them. We also have a great option here that isn't available through the basic Time Machine interface which is to limit the amount of space that Time Machine uses on a per machine basis. A great way to plan storage space.

As soon as the settings are applied you can see if your computer has picked up the settings that apply to it by opening up a terminal and typing "mcxquery" to see all the preferences that are being managed.

You should see the above Time Machine preferences in the output.

Fantastic. All your computers are now automatically backing up using Time Machine to a remote share that you specified! They even have usage quotas. You'll never buy a time capsule again, especially as you can replace the drive attached to your server as needed!

Further Reading

Download Apple's Server Admin Tools for your admin machines

No comments: