Verify Time Machine and Time Capsule Backups

Is Your Backup Ready to Be Used in an Emergency?

Time machine with cogs and gears
You can use terminal to verify your Time Machine backup. Adelevin / Getty Images

Time Machine is a pretty handy backup system for the Mac. I like it primarily because it's a set-and-forget system. Once you set it up, you rarely have any reason, other than curiosity or a disaster, to make use of a Time Machine backup.

But how do you know those Time Machine backups are actually good, that you can rely on them if your Mac's drives come crashing down around you?

Well, if you happen to use a Time Capsule as the backup destination for your Time Machine backups, you can have Time Machine verify that the most recent backup was completed successfully, without any errors that would cause you grief down the road.

If, on the other hand, you're using a local drive, either internal or attached to your Mac as an external drive, then verifying that a Time Machine backup is correct is a bit more difficult, if not nearly impossible.

Let's start with the simpler verification, that of a Time Machine backup on a Time Capsule or other networked storage device.

Verify Time Capsule Backups

WARNING: This tip only works for Time Capsules used as Time Machine backup destinations. If you're using a local drive on your Mac, the steps below won't actually perform the verification process.

To access the Verify Time Machine option, you must have a Time Machine status icon in your Mac's menu bar. If the Time Machine status icon is present in your menu bar, you can skip to Step 4.

  1. Launch System Preferences by clicking the System Preferences icon in the Dock, or selecting 'System Preferences' from the Apple menu.
  2. Select the Time Machine preference pane, located in the System area of the System Preferences window.
  1. Place a checkmark in the 'Show Time Machine status in the menu bar' box.
  2. Option-click the Time Machine status icon in the menu bar.
  3. From the dropdown menu, select 'Verify Backups.'
  4. The backup verification process will begin.

If a message displays telling you that you must create a new backup, then a problem has prevented your current Time Machine backup from being usable.

Click the Start New Backup button to create a new backup and remove the existing backup. This will remove all of your present backup history.

If you click the Backup Later button, then Time Machine will stop performing backups; in 24 hours, it will display a reminder to start a new backup. Time Machine will remain turned off until you start a new backup.

To view the Verify Backup status message again, select 'Backup Now' from the Time Machine status icon in the menu bar.

Verify Time Machine Backups

Verifying a Time Machine backup is difficult, due to the very nature of how Time Machine works. The problem is that by the time a Time Machine backup has completed, the source (your Mac) has likely already made changes to the local files. A simple compare between the Time Machine backups and your Mac would likely indicate that they're not the same.

If we only asked for a compare against the last batch of files Time Machine backed up and your Mac, we might have better luck, but once again, there's no guarantee that a local file on your Mac hasn't been changed or removed, or that a new file hasn't been created on your Mac in the interim.

However, even with the inherent problems created by trying to compare a past slice of time to the current state of your Mac, there are some built-in Terminal commands that can, at the very least, give us a warm, fuzzy feeling that everything is probably all right.

Use Terminal to Compare Time Machine Backups

Time Machine includes a command line utility for controlling how Time Machine functions. From the command line, you can manipulate Time Machine backups, compare current backups, and edit the exclusion list.

The feature we're interested in is the ability to compare backups. To do this, we're going to use the Time Machine Utility, better known as tmutil.

The tmutil has a compare function that can be used to compare one or more Time Machine snapshots. We're going to use tmutil to compare the most recent snapshot against the source (your Mac). Because we're comparing only the most recent snapshot, we're not comparing the entire Time Machine backup to the contents of your Mac, unless this is the very first backup you've made with Time Machine.

  1. Launch Terminal, located in /Applications/Utilities.
  2. In the Terminal window that opens, enter the following:
    tmutil compare –s
  3. You can triple-click the above line to fully select it, and then use copy/paste to enter the line in the Terminal window.
  4. Once the command is entered in the Terminal window, press enter or return.
  5. Your Mac will start processing the compare command. This can take a bit of time, depending on how large the last Time Machine backup was. Don’t worry if it seems to take forever; remember, it's comparing files.
  6. The results of the compare command will be a list of files that were compared. Each line in the list will start with either a + (plus sign), a - (minus sign), or an ! (exclamation point).
  • + indicates the file is new, and not in the current Time Machine backup snapshot.
  • - means the file has been removed from your Mac.
  • ! tells you that the file exists in the Time Machine backup, but the version on your Mac is different.

    The compare command will also list the size of the file in each line. When the compare command completes, you will see at the button an overview telling you how much data was added, how much data was removed, and how much data has changed.

    Interpreting the Results

    It's difficult to analyze the results without making some assumptions, so let's assume a few things.

    The first assumption is that you ran the compare command within a few minutes after the completion of a Time Machine backup. In this case, you should expect to see zero files removed, zero files added, and a very low size for files that have changed. You could see zero for changed files, but the more likely result will be a very small amount.

    The second assumption is that you've waited some length of time since the last Time Machine backup completed. As time goes by, you should see an increase in the Added and Changed entries. You could still see a zero in the Removed category; it really depends on whether you've deleted files that were in the recent backup.

    A glaring indicator of an error would be an unusually large number of added or changed files, especially if the compare was performed just after a backup completed.

    What to Do If You Think You Have a Problem

    Try restoring a few files from the Time Machine backup. Be sure to use one or more of the files from the Terminal compare list to restore.

    If the files restore without issue, then it's likely that there really isn't a problem, and you just had a lot of file changes or additions. This can easily happen, especially if you're using your Mac during the backup and compare process.

    Don’t forget that you can also use Disk Utility's First Aid function to check the integrity of your Time Machine drive. This is something you should do on a regular basis; it's a good preventive maintenance task, one you should be performing on a routine schedule.

    Repair Your Mac's Drives With Disk Utility's First Aid (OS X El Capitan or later)

    Using Disk Utility to Repair Hard Drives and Disk Permissions (OS X Yosemite and earlier)

    Reference

    tmutil

    More From Us