2

This is close to other questions, but I'm having trouble narrowing down the 'optimal' solution for my use case, if there is one. AFAIK this is not a dupe because OSX has different options relevant for its particular flavor of hard drive format. This is also a laptop use case, so I'm looking for solutions that are relatively quick, and they probably can't run on a cron (in case I forget to plug the external drive in before bed).

Here's what I'm using:

  • using OSX snow leopard 10.6.7
  • rsync version 3.0.7 protocol version 30
  • backup to laptop hd in external enclosure
  • one partition only

Here's what I want to be able to do:

  • shut down my laptop
  • take the disk out of the external enclosure and put it into my laptop
  • run laptop

So, this is not a true backup system per se -- deleted files remain unrecoverable, just an insurance policy against hd failure. Note that I should not have to reinstall any applications or operating systems.

Here's what I'm doing now:

sudo rsync -aNHAXx --fileflags --protect-decmpfs --force-change --progress / /Volumes/EXTERNAL/ 

I have yet to test this. (So first question, you think this will work?)

My question is, what can I do to improve on what I'm doing in this command line (other than putting it in a script)? What am I not considering?

Thoughts I have:

  • am I really preserving everything I will need
  • what can I exclude? -- spotlight files? caches?

(Inspired by codinghorror What's Your Backup Strategy? post which is now dated.)

John Hinnegan
  • 125
  • 1
  • 4
  • Since someone recently commented, I have been using CarbonCopyCloner. This question is now relevant again, though, as they are no longer free. – John Hinnegan Sep 11 '12 at 01:38

3 Answers3

3

My rsync script for a periodic disk clone to a disk mounted at /Volumes/Backup1 is:

sudo rsync -xrlptgoEv --progress --delete / /Volumes/Backup1/

(optional) sudo bless -folder /Volumes/Backup1/System/Library/CoreServices

That's a full bootable clone of the drive.

A few points:

You don't necessarily need to install the backup drive into your laptop. I don't see any reason you wouldn't be able to boot directly from the disk while it's in its USB or Firewire enclosure. (Hold Option at boot to select the boot disk)

Some utilities like Carbon Copy Cloner do this just as well and provide a cleaner interface.

ewwhite
  • 197,159
  • 92
  • 443
  • 809
  • From rsync --help `-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)` so we could shorten your command to the following `sudo rsync -axEv --progress --delete / /Volumes/Backup1/` Unless of course you're going for clarity. – Pouria Almassi Dec 18 '16 at 11:49
1

I never argue with things inspired by jwz's "Backups" post. But:

First, I'd still put it in cron, and if you're worried that you'll forget to plug the drive in, then adjust your upcoming script to check for the existence of the backup volume before running the rsync. Something like:

if [ -d /Volumes/Backup ]; then
    sudo rsync -vaxE --delete --ignore-errors / /Volumes/Backup/
else
    # email, SMS, or DM a warning that the overnight backup didn't happen
fi

Second, I'm not sure if I'd use --force-change. There's normally no reason to back up data that hasn't changed, and that will slow your backups down considerably.

Third, the best test of whether or not you preserved everything you need would be to drop the backup drive into your internal bay and see if it boots and you have what you need. Odds are, you will. It's just files on a filesystem.

Fourth, I don't think I'd sweat the time to back up Spotlight caches and other things. I doubt they take up that much space, or that many files, compared to your main body of data.

Mike Renfro
  • 1,301
  • 1
  • 8
  • 11
1

If you want to be able to pull the hard drive out of the enclosure and put it into the laptop you're better off using Carbon Copy Cloner. It's built from the ground up to deal with this use case.

Scott Keck-Warren
  • 1,670
  • 1
  • 14
  • 23
  • I would second CCC for a full system backup! It even features a GUI for creating a LaunchD job. – shustak Sep 09 '12 at 20:26