Tag Archives: backup
title-icon-code

Introducing Counterpart: a live bootable clone tool for OS X

These days, backing up Mac OS X Server is easier than ever, with plenty of options available for taking incremental backups of system and service data, and great support from Time Machine’s ServerBackup process in making sure that databases and Open Directory are included in hourly backups.

All of these great options have one thing in common though: restoration. In a production environment, as lovely as backups are; admins are often hounded by management and users when hardware fails, and time elapses whilst operating systems are re-installed and service data rolled back from backup drives. To combat this downtime, I like to keep a fully bootable backup connected to each production server that is as up to date as possible. In many situations, this allows you to get a slightly data-delayed version of your environment up and running until you can schedule proper downtime to restore backed up data. For years, I utilised Mike Bombich‘s fantastic tool Carbon Copy Cloner, along with it’s excellent Scheduled Tasks functionality for this exact purpose. With it’s recent move to shareware, I decided that there really should be a free, open source script for cloning Mac OS X that can be scheduled with launchd, and provides proper logging and statistical data. It is with this that I announce the release of Counterpart; a wrapper script for rsync on OS X that is capable of producing bootable clones of live Mac systems. I have been using this for a little over 6 months to backup hundreds of OS X systems, and it has made my life so much easier a couple of times during hardware failures.

Counterpart utilises rsync, the fantastic data and synchronisation utility, and wraps it in a script that provides the correct settings and filesystem exceptions to create a bootable clone of a live Mac system, whilst error checking and providing comprehensive logging, statistics and monitoring data. It is bundled with detailed documentation and instructions on scheduling clones. Coming soon is a companion Nagios plugin script to monitor clones and provide performance data, meaning you can be sure clones are completing successfully, and get insights into your backup data like this:

Counterpart Clone Statistics

It should also be said that whilst Counterpart was first envisaged to backup Mac OS X Server instances, there is nothing stopping it being used to back up standard OS X clients, and it would be a great, fully scriptable, free way to create a bootable clone of your OS before an upgrade or significant modification to your system.

I have uploaded Counterpart as a new project on GitHub, and welcome any feedback that you may have on using it. I am also happy to answer any questions on getting it set up in your environment, and I am best contacted using this form.

Counterpart on GitHub

title-icon-code

Checking Carbon Copy Cloner with Nagios

In many Mac OS X Server deployments that I see, a file level cloning tool such as Carbon Copy Cloner or SuperDuper is used to keep a bootable backup of the server OS on a secondary drive. Whilst this is not a coverall backup strategy, nor effective for all services (databases and other files can be left in an inconsistent state on disk), it does provide an excellent emergency boot option that can have essential services back up and running very quickly in the case of a primary drive failure.

Generally, I use a scheduled task with Carbon Copy Cloner (CCC) at about 1am each morning to do a full clone of data from the boot drive to a secondary. It is possible for this process to provide email notifications on completion or failure, but as I prefer all my monitoring through Nagios, I have developed a script to track and check for successful CCC clones.

Full instructions are in the header of the script, but it has a dual purpose. On the Nagios end, the script checks for the existence and age of a hidden file on the clone destination that signifies when the last successful clone took place, and a warning is thrown based on the age threshold you supply. On the CCC end, you simply choose the script as the post-clone scripting action for your scheduled task, and it will handle the creation of the hidden file on your destination if the clone was successful.

It has been added to my OSX-Monitoring-Tools project on GitHub today.

check_ccc_currency.sh on GitHub

title-icon-code

Checking Time Machine and CrashPlan backups with Nagios

Latest Backup: Failed....

When monitoring client servers, I find it very valuable to keep track of of the currency of backups, particularly where there may be long periods between us getting hands on with equipment.

I can still feel the pain of clients who inadvertently disconnect their local backup solution, only to have a major crash weeks later.

In some of the small business deployments that we actively monitor, local Time Machine and CrashPlan backups are popular, and where appropriate, we like to get a notification if one of these has failed to complete a backup within the last day.

I have added the scripts we use to GitHub today, and hope you find them useful. They actively parse and analyse the completed backup timestamp logged by each service, so they are a little more reliable than checking file age on a specific directory or file within the backup.

Visit OSX-Monitoring-Tools on GitHub