Last modified 4 years ago Last modified on 04/07/16 15:40:17

We use CrashPlan to implement our Research Backup service.

Playing with the CrashPlan REST API can be fun

It has an HTTP API which spits out JSON that you can use get information about your account and carry out pretty much any action accessible through the web user interface. The official API is maintained on GitHub. Combine this with some command line tools or custom python scripts and you've got the beginnings of some very powerful and informative extensions to your backup process.

The latest version of the API is documented here:

but you can always see the version for our instance of crashplan here:

The basics of getting started is to use curl to query the server using your account credentials and getting back JSON objects which you then parse. To see your account information you can issue a command like:

curl -u 'username:password' ''

Note this uses your CrashPlan username and password, the ones you would use to log into the web site, which currently are separate credentials from your BlazerID.

You can simplify parsing JSON from the command line using a neat little tool called sql4json. Install it on ubuntu with:

sudo apt-get install python-pip
sudo pip install sql4json

Putting this all together, you can then write some basic scripts. Here's a simple script that will print the size of the backup archive for each of your devices:

for archive in `curl -su 'user:pass' '<id-from-the-My-command-above>' | sql4json --csv 'select archiveBytes, computerId from data/archives'`
   size=`echo $archive | awk -F, '{print $1}'`
   cid=`echo $archive | awk -F, '{print $2}'`
   name=`curl -su 'user:pass' "$cid" | sql4json 'select name from data' | cut -d\" -f4`
   echo $name "," $size

The extra parsing of the name arg is needed because sql4json doesn't seem to handle arrays very cleaning at this time. But it's still pretty easy to parse a much simpler output of sql4json.

Sure you can log into the web ui and see all this nicely summarized, but follow the above helps you take the first steps in customizing your backup process.

Maintenance Tasks

Remove a device from your account

Devices are the individual computers on which you run the CrashPlan software to maintain backups. If you are reconfiguring your backup environment you might want to permanently remove a computer and any of the data that had been backed up on that computer from your backup process.

Follow these steps to remove a computer using your desktop CrashPlan app. This action permanently deletes the backup data created on that computer.

If you no longer want a computer to be backed up but do want to hold on the the existing backup data maintained for that computer you have several options. You can simply stop the backup agent on the computer you no longer want to backup. This will prevent new back up data from being added but will retain your existing backup data. There are additional options like migrating data to a new device, see the CrashPlanDocs for more information.

Remove a user from the backup

If a user no longer wants to use the research backup or tries it out but then decides against it they will have some backed up data that needs to be cleared out so it doesn't consume resources anymore (licenses and/or storage). Users and devices are "deactivated" rather than "deleted" in CrashPlan. When a device or user is deactivated any backups they had go into "cold storage" which is functionally like a desktop Trashcan or Recycle bin, any data in cold storage can still be recovered for a configurable time period. However, cold storage uses up storage space and consumes a user license. If a user or device is removed permanently, they need to be deactivated and have their cold storage purged.

WARNING: purging cold storage deletes all data for the user and/or device and it can no longer be recovered.

The steps are easy and carried out from the admin console.

  1. Deactivate the user or device.
  2. Purge the associated cold storage for the user or device.

Client Compatibility

Ubuntu 14.04

If you are trying to run your CrashplanDesktopClient on Ubuntu 14.04 after upgrading from 12.04 and all it does is crash after the splashscreen you may have in issue with the java settings from the GUI environment. The solution is detailed in this article and requires adding a JAVA opt "-Dorg.eclipse.swt.browser.DefaultType?=mozilla" to the GUI_JAVA_OPTS in the ~/.crashplan/bin/run.conf file.

Note this issue can still affect Ubuntu 14.04 boxes for Crashplan 4.x clients and will re-appear after upgrades to the client software. If the crashplan install is a personal install then the file to edit is ~/crashplan/bin/run.conf.