Changing the CrashPlan primary server by terminal commands on a Mac

We recently wanted to change the primary server for our CrashPlan clients from an IP-based one to a DNS-based one. Unfortunately, CrashPlan doesn't have a .plist file you can just run a defaults write command on.

So apart from going into every machine and manually changing it from the menu bar, there is a way to script it. Thanks to ahbeng's GitHub port change script for inspiration on this, but we also got confirmation directly from Code42 that this would work.

Basically, you just want to stop the CrashPlan engine, tweak the text file, and then restart the engine. This works on CrashPlan PROe 4.2. You may have to look for a slightly different file if you're running a different version of CrashPlan PROe.

#!/bin/bash
# Unload CrashPlan's engine, substitute the new string in, and then load the engine back again
sudo launchctl unload /Library/LaunchDaemons/com.crashplan.engine.plist && sudo sed -i '' -e "s/IPADDRESS/SUBDOMAINANDDOMAINNAME/g" /Library/Application\ Support/CrashPlan/conf/my.service.xml && sudo launchctl load /Library/LaunchDaemons/com.crashplan.engine.plist && open /Applications/CrashPlan.app/Contents/Helpers/CrashPlan\ menu\ bar.app
Obviously, substitute in your IP address for IPADDRESS and your actual FQDN for SUBDOMAINANDDOMAINNAME.

Nota bene: If you have deployed your CrashPlan with a custom.properties file, you may have to modify that file as well. Just throw in a

sudo sed -i '' -e "s/IPADDRESS/SUBDOMAINANDDOMAINNAME/g" /Library/Application\ Support/CrashPlan/conf/custom.properties
as well when you've stopped the CrashPlan engine

Leave a Reply

Your email address will not be published. Required fields are marked *