Chapter  20

Time Machine Backup and Recovery

Most people who have been around computers for a long time have horror stories of disk crashes and data loss. And even if your story isn't horrific, you probably have an "Oh, $#!*!" moment or two when things go wrong and you lose an hour's or a day's (or more) worth of work. The thing is, the minute your hard drive was created, it started a countdown toward its mean time before failure (MTBF—a rating that measures the average amount of time before a hard drive fails); of course, more frequently, we tend to occasionally make mistakes (either as a user or as a developer), so we must make sure we have effective ways of backing up and syncing our data.

This chapter is dedicated to backing up and syncing data, not because it's a terribly long and complicated thing to explain (in fact, Mac OS X makes it relatively easy these days) but because it's such an important topic that it deserves to be treated on its own. In this chapter, we will cover the following:

  • The difference between backup and synchronization and what's appropriate in what circumstances
  • Keeping your computer's data backed up using Time Machine
  • Other methods of backup, syncing, and data recovery

The Difference Between Backups and Synchronization

Before we go too far, it's important to make some general differentiations between a backup and a sync. In overly simple terms, suppose you have two disks: disk A and disk B. When you back up disk A to disk B, you make an exact copy of disk A's data onto disk B. This assures that in the event that something undesirable happens to the data on disk A (or if disk A fails altogether), you can revert to the backup data on disk B. When you synchronize disk A with disk B, the information on each disk is usually copied to the other so that the data on each drive matches. One special feature of some backup applications is that they archive old information that has been deleted or changed. This can be known as an archived backup or versioned backup, but whatever it's called, it allows the added benefit of looking "back in time" to find files that may otherwise have been deleted (this is how Time Machine works). If you are more of a visual thinker, these differences are illustrated in Figure 20–1.

Image

Figure 20–1 Differences between backups and synchronization

NOTE: These descriptions of a backup and a sync, along with Figure 20–1, are meant to provide a simplified (perhaps overly simplified) differentiation between backups and synchronization. The reality can be much more nuanced. For example, while a backup only provides a one-way transfer of data (i.e., backing up one data source to another), synchronization can provide both a one-way and/or a two-way transfer of data, depending on settings. (In fact, when you first sync data, you're often asked if you want to copy source A to B, copy source B to A, or synchronize A and B. If data changes on both sources, most sync programs will ask you which change you want to use.)

DEFINING AN ARCHIVE

Generally, when you want to keep an extra copy of your important data in case something happens to your primary data store, then what you want is a backup. When you have two data stores that you need to keep current with each other, then what you want is synchronization. Either way, you are creating a redundancy that is important should one data source fail. One important note, though: creating a backup with archiving is the only way to effectively protect against file corruption. If you synchronize or simply back up a corrupted file, then you are just creating a new copy of a corrupted file, often overwriting an old, uncorrupted file.

Backing Up Your Data with Time Machine

Mac OS X includes a fantastic little backup utility called Time Machine. Time Machine provides data backups of all your information complete with a historical archive of data. The best thing about this is that Time Machine does all of its work automatically in the background, making it painless (in theory). However, like any good backup utility, in order to take full advantage of Time Machine, you will need an extra hard drive connected to your computer for Time Machine to back up data to.

NOTE: When deciding whether to invest in an external hard drive for Time Machine to use, ask yourself how much the data you keep on your computer is worth. You can easily find a nice-sized external hard drive these days for less than $100, and in my opinion, our data is worth at least that.

NOTE: In the past some people would create a Time Machine backup to a different partition on their primary hard drive. Although this wouldn't help if your hard drive had a mechanical failure, it would provide archives of old files. Lion's new Versions feature (covered in Chapter 5) provides this for you (provided you are working with an application that supports it), so this is probably not necessary anymore.

NOTE: Time Machine will eventually use all the free space on the drive or partition you set for it. So, if you want to use a hard drive for both Time Machine and anything else, then you'll most likely want to partition the drive, dedicating one partition to just Time Machine. (I covered how to partition drives in the previous chapter.)

Setting Up Time Machine

To set up Time Machine:

  1. Open the Time Machine pane in System Preferences (Figure 20–2).
    Image

    Figure 20–2. The Time Machine preference pane prior to setting up Time Machine the first time

  2. Click the Select Disk… button, which opens up a dialog box (Figure 20–3) allowing you to select the desired backup disk. Select the desired device and click the Use for Backup button. This selects the device automatically, turns Time Machine on, and starts a 120-second countdown until your first back up. Time Machine is now ready to go.
Image

Figure 20–3. The dialog box asks you which device you want to dedicate to Time Machine.

NOTE: If you haven't set up Time Machine already, when you first connect an external hard drive, you will be asked if you'd like to use that drive as a Time Machine backup. If you choose Yes, then you can bypass the previous steps.

NOTE: If you are using one of Apple's Time Capsule network devices for backup, you may select the Set Up Time Capsule option. This launches the AirPort Utility to allow you to select the appropriate Time Capsule device to use. Once set up, using a Time Capsule will work as seamlessly as any other external backup device.

Once you've selected a backup device, the Time Machine preference pane changes to offer more information and options (Figure 20–4).

Image

Figure 20–4 The Time Machine preference pane changes to offer more options once you choose a Time Machine device.

Selecting the Options… button opens a dialog box (Figure 20–5) that allows you to tweak a few options, the most important of which is the ability to select any folders or attached devices that you want Time Machine to ignore (and thus not back up).

Image

Figure 20–5 The Options… dialog box provides some added options that affect how Time Machine works.

This is particularly useful if you have large files or archives that are backed up with other methods, if you don't care whether they are backed up, or if you have folders containing sensitive data that you don't want archived.

NOTE: You also may want Time Machine to ignore very large files that change often-for example, virtual disks from VMware Fusion or your Entourage database (no longer an issue if you updated to Outlook 2011 for Mac, though). However, if you do have Time Machine ignore these files, you may want to back them up manually (especially your Entourage database, if that's your primary e-mail and contacts tool). If you don't ignore these every time you make even a small change (which happens constantly when, in the case of the previous examples, a virtual machine is running or Entourage is open), then Time Machine will detect a change, back up the entire file, and archive the old. Not only will Time Machine be running constantly, but its drive will fill up with lots of large, slightly changed, archive files.

NOTE: When you initially set up Time Machine or select a new Time Machine device, the initial backup may take a long time to complete. Once it completes, Time Machine will back up only new or altered items on your hard drive. These backups are generally quite fast unless you're doing manual or infrequent backups.

Using Time Machine Manually

When Time Machine is active, it makes automatic backups every hour. This keeps a rather complete record of changes to your system should anything minor or major occur, from the accidental deletion of a file to a dreaded hard-drive failure. If, however, you would like to forgo this level of detail and control your backups manually, simply turn Time Machine's OFF-ON switch to OFF. If you want to use Time Machine manually, it's handy to have the "Show Time Machine status in the menu bar" option selected. This allows you to select Back Up Now from the menu bar at any time and create a backup manually (Figure 20–6). Alternately, you can select the Back Up Now option by Control-clicking the Time Machine icon on your Dock.

Image

Figure 20–6. The Time Machine icon in the menu bar allows you start a Time Machine backup manually.

Using the Time Machine Interface to Recover Data

Once Time Machine is set up, it should begin keeping an up-to-date archive of the data on your system. Through the Time Machine interface (Figure 20–7), you can use Time Machine to recover past files that have been altered or deleted. Additionally, should your primary hard drive ever crash and you need to do a clean install of OS X (or you just want to do a clean install of OS X because you have some extra time on your hands), you can recover all of your data from your Time Machine backup either during the install processor at a later time using the Migration Assistant application.

Image

Figure 20–7. Time Machine browsing Finder items as they were backed up through time

You can enter the Time Machine interface by clicking the Time Machine icon, just as you would launch any other application. Alternately, you can select the Enter Time Machine option from the Time Machine menu icon (unless you've disabled it). To recover any data from the Time Machine archive, you may navigate through the single Finder window normally and then simply use the arrows or the timeline along the right side of the interface to navigate "back in time" and select the item you want to recover. Once you select the desired item, click the Restore button in the lower-right corner. This brings you out of the Time Machine interface and places the recovered file in its original Finder location. If an item of the same name already (or still) exists in that place, then you will be prompted to keep either or both files.

NOTE: Time Machine assumes that the selected Time Machine disk or partition exists solely for Time Machine archives. It continues to fill up this drive with archives until the drive is full. When the Time Machine device is full, Time Machine begins to delete the oldest archived files to make room for the newer ones. If the "Notify after old backups are deleted" option is selected, you will be prompted after Time Machine overwrites old files.

If you want to leave Time Machine without restoring any items, just click the Cancel button in the lower-left corner of the Time Machine interface.

When you launch Time Machine, it usually opens up in the active Finder location; however, certain applications are also Time Machine-aware. One example of this is Apple's Mail application. Opening Time Machine with Mail active provides a Mail window in Time Machine so you can go back and find old deleted messages (unfortunately, you can't use Time Machine to go back and not send old sent messages).

NOTE: Time Machine goes beyond just backup and actually provides a personal version control system as well. Version control tracks changes of items over time so that you can recover older versions if something critically wrong happens in a new version. For developers, version control (or source code management [SCM]) is essential for creating stable software, and support for a number of version control systems, including CVS, Subversion, and Perforce, are built into Xcode. For more general project version control, Versions (www.versionsapp.com), not to be confused with the Versions feature in Mac OS X, provides an easy-to-use interface for taking advantage of the Subversion version control system. One significant difference between Time Machine's version control and professional SCM is that the SCM tools are designed to keep track of changes made by a large number of different users, while Time Machine just tracks changes, not necessarily who's making them.

Other Methods of Backup, Sync, and Recovery

Besides Time Machine, you can use a range of other utilities, applications, and methods to protect your data. Some applications, such as Apple's Aperture, provide an integrated means of backing up and archiving their data.

If, however, Apple's backup tools don't quite fit your needs (or for whatever reason, you just don't like them), these other applications are worth a look:

  • Decimus Software (www.decimus.net) makes two different backup applications depending on your needs: Synk Standard and Synk Pro. These apps range in cost from $40 to $60. Although the Standard version handles most common backup and synchronization tasks, the Pro version adds some nice features, and at $60, it offers the best bang for your buck.
  • CrashPlan (www.crashplan.com) provides tools for backing up your data to multiple locations including online storage. The basic CrashPlan consumer application is free; however, with the CrashPlan+ options you gain online storage for additional security (10GB for $24.99 a year or Unlimited for $49.99 a year).

NOTE: Two other backup utilities worth considering areSuperDuper! (www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html) and Carbon Copy Cloner (www.bombich.com/software/index.html). What sets these apart from the others is their ability to keep up-to-date clones of your system; in other words, these backup utilities maintain a fully bootable copy of your system that can be swapped in for your primary system drive at a moment's notice, should the need ever arise.

What's most important-whether you use Time Machine, use Retrospect, or copy all your data onto thumb drives manually-is that you do something to back up your data. Just pick a system that works for you and go with it.

Summary

Now that you know how to protect your data from hard drive failures and accidental data loss, we'll move on to some general OS X maintenance tasks to keep your system running smoothly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset