Last week I was asked whether I could produce a script that would keep track of Carbon Copy Cloner backup tasks so that a user could tell which of many, multiple backups of the same source disks were the most recent.
Of course, CCC has its own Task History and Disk Center functions to provide information, but these turn out to be insufficient in common scenarios. To see why, let’s consider a hypothetical task set-up and recovery situation.
In this situation, let’s suppose I’m keeping 2-hourly, daily and weekly clones of my mac’s internal disk. While I’m logged in to my mac, I can of course check CCC’s Task History to see when the last back up was, the destination, and whether it was successful or not.
However, suppose the internal disk fails – just the situation for which I keep my CCC backups on a regular schedule. Which disk contains my latest backup? The information from CCC’s history task is on the failed internal disk, so it is not now available to me. Of course, each backup contains CCC’s earlier History too, but there’s several problems here. First, these cloned task histories do not contain the history from the *last* task (that’s only written to the source disk after the last backup completes). Second, to compare them, I’d have to boot each clone individually – a time-consuming and not terribly convenient process. Third, CCC’s ‘Disk Center’ only provides backup information about connected disks if the current startup disk was used to run the backup task. Thus, if I backup Disk B from Disk C, that information won’t be available to me when I startup my mac with Disk A.
Before I discuss the solution to this, let me just complicate the scenario further. I have two other macs – two 13″ MacBook Pros that have been going strong since 2009 – each of which I backup to individual clones. There’s no way for me to see all the backup dates from all my macs with CCC. Further, we don’t need to consider only disk failure as a reason to need comparative backup history. Since some files are shared or swapped across my three macs, there’s no way to find out from CCC’s Task History or Disk Center when the latest backup of any particular one of those files was made, or on which backup disk I can find it. For example, the connected disk ‘MBP Z Clone’ is a scheduled task on my MBP, but looking at this disk when connected to my iMac gives me no information about its backup history:
Fortunately, CCC has two features which make our problems solvable. First, each source disk keeps detailed logs of the backups it has run (from which the Task History and Disk Center info is constructed); secondly, CCC allows us to run a shell script after each task has completed.
These two little features are going to allow us to build a shell script that will write a special log file to the destination after each task completes, and then retrieve it and compare it against both the current source and other disks. That means we’ll be able to get CCC backup data from any disk we connect to any mac, since the data will be stored on the destination disk itself thanks to our shell script (for the technically minded: to avoid permissions problems, the script writes to /Users/Shared/ if it’s a bootable clone, or to the root of a disk that isn’t).
That’s the outline of the problem and the solution. What started out as a simple AppleScripting task soon blossomed into a full-blown app. Although much of the background work I’ve outlined above is achievable via AppleScript, displaying the data effectively is rather cludgy, even if one uses some of the excellent scripting libraries like Shane Stanley’s ‘Myriad Tables’ to improve on the stock AppleScript offerings.
Accordingly, after about a week or so of wrestling with an acceptable solution, I finally came up with the Disk Inspector.app to solve all these problems in one go and add a few niceties on top. 😉
Whatismore, since it’s Christmas :D, I’m publishing this as a free utility on my software site, Sqwarq.com. Check out Disk Inspector’s support and download page here: https://sqwarq.com/disk-inspector
Here’s a quick overview of the main features:
1. See dates of all connected disks that have been backed up via CCC*
2. See the latest backup and (if available) Time Machine backup for the current source disk
3. See the OS Version and Build Number on connected, bootable drives
4. Open any disk’s root folder in the Finder by double-clicking its name in DI’s main view
5. See an estimate of the total and available space on each disk (rounded to the nearest GB)
6. Save all the data to a log file for easy record keeping of your backups
* after completing Disk Inspector’s set up procedure
For full instructions refer to the Support page, but the basic idea is that on first launch, you run the ‘Set Up’ wizard to configure your tasks in Carbon Copy Cloner. Disk Inspector’s ‘Set Up’ wizard walks you through 5 simple steps to accomplish all this.
Once you’ve completed the set up procedure and each of your scheduled CCC tasks has run, you’ll start to see information for each backup disk in Disk Inspector’s main view on any mac (or on the same mac booted from a different drive) that you subsequently connect those disks to.
Disk Inspector runs on 10.10 and higher.
Enjoy, and Happy holidays to all! 😀
Nearly three months since the initial public release of OS X Lion 10.7 and a couple of updates later (we’re currently at Release 10.7.2) a lot of upgraders are reporting problems to Apple Support Communities. These problems could be avoided or their severity reduced if people upgraded in the right way.
There’s a wrong way? Oh yes…the Apple way is to encourage you to click on the App Store, click on Lion, pay your money, sit back and watch as everything falls into place without barely a finger lifted from the user. That’s great — when it works, but as noted, a lot of people are finding that all sorts of things are going wrong from software incompatibility to hardware incompatibility and sometimes (like in my own case) just plain user incompatibility (yes, some of us — and it could be you too! — are just not that thrilled with the reduced configurability and usability of Lion compared to Snow Leopard, even when it works as intended). There’s also some reported problems even with Apple’s own products: Time Machine, Time Capsule and Spotlight are all being reported as having problems for some users.
But much of this need not give you a headache, put your computer out of action or require a call to Apple Support if you follow the golden rules to doing any major OS upgrade.
Golden Rule No. 1: Check the compatibility of your key software tools.
Why do I need to do this?
Lion does not support a lot of older technologies such as Rosetta and PowerPC apps. If you make heavy use of these programs in your daily use, you’re going to need to upgrade those too or continue to run Snow Leopard on an external disk.
Golden Rule No. 2: Buy an external disk and clone your current system to it.
Why do I need to do this?
Without a doubt, this is the most important thing you should do before upgrading. What cloning means is that if anything goes wrong with the install, if it doesn’t work, or it isn’t to your taste, you can simply boot back into your old system within minutes (no longer than it takes to restart the computer, in fact). Your clone is your insurance, a fail-safe against the unexpected. Don’t even think about hitting that App store upgrade till you have your clone in the bag.
Or what? Simply put, if you don’t make a clone of your system, you’re going to have to live with any problems until you can work out a way to either solve them (and some issues haven’t even been resolved yet) or revert back to your previous OS the hard way, with the potential of data loss.
Although cloning your system will cost you the price of an external USB or Firewire hard disk, it’s an investment you should not overlook. Even if your upgrade goes well, keep the clone for a month or so till you’re sure everything works fine. Once you’re happy, you can use that disk to clone your Lion OS regularly as an incremental backup (like Time Machine only more configurable and less erratic!).
Golden Rule No.3: Make sure you have a bootable DVD or USB recovery disk.
Why do I need to do this?
Unlike every other proprietary OS upgrade ever, Lion is downloaded from the internet and does not come with an install disk. Does it matter? Well, yes. Sometimes Lion doesn’t install properly for a number of different reasons and sometimes your system just goes belly-up. Now you may have heard that Lion comes with its own recovery partition, but that assumes that the recovery partition installs properly, and it relies on having an internet connection. Re-downloading the installer takes a lot longer than simply copying it the first time and making a bootable Lion recovery disk in case of emergency.
Golden Rule No.4: Do a clean install to your internal disk.
Why do I need to do this?
A clean install basically means two things: you wipe the history of the disk you’re going to use for your new OS, and you don’t import any settings from your previous OS. This should ensure that the OS installs exactly as it was designed, without being infected with any hidden or unknown problems from your previous OS install.
Golden Rule No. 5: Use the clone to add manually the stuff you use everyday, and as-and-when you need it for other stuff.
Why do I need to do this?
Using the auto-upgrade, Time Machine or Disk Migration features have been known to introduce problems such as corrupted files and permissions that Snow Leopard ignored for some reason or other but which Lion won’t tolerate, and/or files and settings which are just plain incompatible with Lion. Trying to find out what is causing your system problems is a gruelling process if you just import everything en masse. On the other hand, if you import things manually over time, it’ll be both a lot easier to figure out which change caused the problem but also — using your clone — to roll your system back if needs be.
Let us know your upgrade stories in the Comments below. Was it just one-click to happiness or a whole world of pain? 😉
What’s wrong with using the cloud? The fact that you need an internet connection, a password to be accepted, to act in accordance with the T&C of your cloud provider, the fact that someone – government, corporation, hacker – could interfere with your data, lose it or just add unwanted stuff to it. Also, if you want to backup your whole system then the various free storage offers are not going to be big enough to do the job, and you’re going to end up paying a lot more than if you backup your system properly.
How about Time Machine? Yes, it’s simple and convenient and pretty much automatic, but its not secure. TM has three major problems. First, it doesn’t allow proper archiving so anything you delete from your HDD will eventually get deleted from TM. Second, it doesn’t tell you what it’s doing before it does it, meaning you are at the mercy of its automated decisions. Third, it’s not bootable. If your whole system crashes or your HDD just fails, Time Machine won’t help you. You’ll have to restore the system or replace the HDD before you can use your machine again.
But there is a much better way, and aside from you providing the hardware (a couple of external hard disks), one that’s also free. The most secure system is to run an hourly or daily scheduled cloner on one disk, and a weekly cloner on the other. You can use SuperDuper or, my own favourite, Carbon Copy Cloner.
If you want to read up on and understand the various backup options and what they entail, you can’t do better than to read this superb post by Apple Discussions member ds store.