Bender - Automated Backup of OS X Server Settings

Ben Greiner -

Click Here to download Bender!

?name=bendericon.png

What is Bender?

Bender is a utility written by Forget Computers to automate the backup of OS X Server settings to provide easy restoration of services should they become corrupt, and for importing server settings after a migration or server upgrade. Additional instructions are available here at krypted.com.


How does it work?

Bender is provided as a simple PKG installer. Once installed, Bender will create a Backup directory in the root of the boot drive. Each evening at 10PM Bender creates the following files (and keeps the backups for 30 days before removing old copies):

  1. A directory with the date and time the backup was run.
  2. An Open Directory archive if the server is running as an Open Directory master.
  3. A single XML plist of all the server settings (running or not) found in either Server Admin or Server (depending on your operating system).
  4. A series of individual XML plists of each server setting, so restoration or import of select settings is possible.


What OS X Server operating systems does Bender support?

Bender is robust and supports OS X Server 10.6 and later, including OS X 10.11 El Capitan and Server 5. (Bender has not been fully tested in 10.12 Sierra.)


How do I use the backups that Bender creates to restore my settings?

To restore an Open Directory archive:

  1. Open Server Admin (in 10.7 and earlier) and select the Open Directory service.
  2. Click on the Archive tab, choose the archive you wish to use and click Restore.
  3. To determine the password used to encrypt the archive, run this command inTerminal:

For older versions of Bender:

/sbin/ifconfig | /usr/bin/grep -m 1 ether | /usr/bin/awk '{print $2}' | /usr/bin/sed 's/://g' | /usr/bin/cut -c 5-

For the current release of Bender:

system_profiler SPHardwareDataType | awk '/Hardware UUID/{print $3}'

Note: There is currently no restore option in Server.app in 10.8 or later, so use the command line:

sudo slapconfig -restoredb /path/to/your/archive.sparseimage

To restore all OS X Server settings:

sudo serveradmin settings < /path/to/your-sa_backup-allservices.backup

To restore a specific OS X Server setting:

sudo serveradmin settings < /path/to/your-sa_backup-servicename.backup

To restore Profile Manager:

sudo cat /path/to/your-profile-backup.sql | psql -h /Library/Server/ProfileManager/Config/var/PostgreSQL -U _devicemgr devicemgr_v2m0

To restore Profile Manager in macOS Sierra 10.12.3 and Server.app 5.2: (Thanks to Paul Roomberg for figuring this out!)

sudo pg_restore <path to .pgdump file> -U _devicemgr

 

Helpful Hint: Terminal in OS X supports drag & drop, so you can simply drag the plist you want to restore instead of typing in the full path.


I've downloaded and installed Bender. What do I do now? Can I customize the settings?

If you change any variable definitions within your deployment please test appropriately! You can edit the Bender backup binary here: /usr/local/robotcloud/bin/bender

To change the default backup destination:

In a text editor (vi, nano, TextWrangler) edit the backupDestination line to point to the external volume of your choice, ex: pathBackups="/Volumes/Drobo"

To change the default Open Directory passphrase:

In a text editor (vi, nano, TextWrangler) edit the ldapPass line with the desired passphrase, ex: ldapPass="BiteMyShinyMetalBackup2016!"

We recommend that you add the Bender Backups directory created by Bender to the scope of your local backup program. If you useCrashPlan PROe you can add this destination as default on all of our managed workstations within a couple minutes. If you use another backup application, your milage may vary.


Contact

Bender is provided under the GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007. For more information, please visit http://www.gnu.org/licenses/. The likeness of Bender is the property of Matt Groening and others.

If you have any questions, feedback or suggestions, please contact us and let us know!

 

Kick Bender Out The Door

Use Terminal to uninstall Bender completely:

sudo launchctl unload /Library/LaunchDaemons/net.robotcloud.bender.plist
sudo rm /Library/LaunchDaemons/net.robotcloud.bender.plist
sudo rm -Rf /usr/local/robotcloud 

ADDITIONAL OPTIONS

If you want to disable Bender backups but not uninstall it, you can use this Terminal command:

sudo launchctl unload -w /Library/LaunchDaemons/net.robotcloud.bender.pist

If you later decide to enable Bender backups after disabling them:

sudo launchctl load /Library/LaunchDaemons/net.robotcloud.bender.pist 

Contribute

Contribute to Bender on Github, or if you've found value in Bender we welcome monetary contributions to support further development.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.