Already a member? Log in

Sign up with your...

or

Sign Up with your email address

Add Tags

Duplicate Tags

Rename Tags

Share This URL With Others!

Save Link

Sign in

Sign Up with your email address

Sign up

By clicking the button, you agree to the Terms & Conditions.

Forgot Password?

Please enter your username below and press the send button.
A password reset link will be sent to you.

If you are unable to access the email address originally associated with your Delicious account, we recommend creating a new account.

URL: http://hints.macworld.com/article.php?story=20110906221223743

10.7: Using two Time Machine backups - Mac OS X Hints

Rotating Time Machine backups has never been easier as of 10.7. Apple included in Lion a command-line interface for Time Machine which makes it completely scriptable. For the complete details on the command-line interface take a look at the man page for

tmutil

.

I use two Time Machine backups (see my backup strategy below for my complete backup solution) one at home and one at work. Using MarcoPolo you can set triggers and actions to automatically switch your Time Machine destination.

At home, and at work, I have 10.7 Server setup running the Time Machine service. Using MarcoPolo my laptop can determine its location, work or home, and set the IP address for my server appropriately. The following are the details on how to set this up for a Time Machine destination of an AFP share point. With small changes, this will also work for a Time Machine destination of an external hard drive.

Note: To alter these instructions to use a local external hard drive, change the following

tmutil

commands to this format:

tmutil setdestination mount_point

where mount_point is the path to your external hard drive.

Time Machine Setup

First we need to create two scripts. I have stored mine in /usr/local/bin. I used the

nano

editor in Terminal to create the scripts; you could also do this with BBEdit or TextWrangler if you're more comfortable with those editors. The two scripts will use the

tmutil

command to switch the destination. To create your first script enter this command into Terminal:

sudo nano /usr/local/bin/switchtimemachinehome.sh

Paste the following into the nano editor:

#!/bin/bash #This will change your Time Machine setting the backup to your home server sleep 5 tmutil setdestination afp://username:password@192.168.1.3/Backups sleep 5 tmutil startbackup

The important line here is the

tmutil

command which is new as of 10.

Share It With Others!

Comments

tmutil setdestination afp://username:password@192.168.1.3/Backups

Rotating Time Machine backups has never been easier as of 10.7. Apple included in Lion a command-line interface for Time Machine which makes it completely scriptable. For the complete details on the command-line interface take a look at the man page for tmutil.

Combine two disks with time machine

anselmdk

Web designer and developer, specialized in developing in HTML5, jQuery and PHP (favourably on the Silverstripe platform