Carbon Copy Cloner and Dropbox

We have started to use the excellent Carbon Copy Cloner (CCC) to sync various Folders on a File Server to a dropbox account to share its content ‘automatically’ with an external party.

Initially we had some problems, as we had simply scheduled a Backup Tlan to run every hour, which resulted in a couple of errors regarding hidden files that dropbox seems to generate for its syncing process and which stalled the CCC backup.

Thankfully the support for CCC is excellent and we ended up getting a solution directly from Mike Bombich, which you also might find useful.

To get it working properly you need to stop and start Dropbox via pre / post flight shell scripts, which can be attached to the Backup Task inside CCC’s > Backup Task Scheduler > Before & After panel.

dropbox_stop.sh
#! /bin/bash
osascript -e 'tell application "Dropbox" to quit'

dropbox_start.sh
#! /bin/bash
sudo -u YOURNAME open -a "Dropbox"

Simply copy and paste the scripts above into the Text Editor of your choice, amend with your accounts shortname, save them as plain text with .sh as extension, then attach them to your CCC Backup Task.

Regarding the ‘sudo -u’, Mike Bombich writes…

“CCC’s pre and postflight scripts run within the root user security context, so there are some limitations placed on the use of AppleScripts and specifically the “open” command. Precede those commands with “sudo -u yourname “(replace “yourname” with your account’s shortname) and the script should work fine.”

We can confirm it does work perfectly.

Next Post

Previous Post