Sysadmin > OSXBackupOpenDirectory

Backup Open Directory

It is not enough to backup the directory service (for example with dsexport). You need so backup several other settings.

You can do this with the Workgroup Manager or the same with a small script from the book "Mac OS X Advanced System Administration" (much better for periodical backups).

#!/usr/bin/env bash 
(umask 077 ; touch sacommands.txt) 
BACK_DIR=/var/backups/odbackup-`date "+%Y%m%d"` 
echo "dirserv:backupArchiveParams:archivePassword = blapass" >> sacommands.txt 
echo "dirserv:backupArchiveParams:archivePath = $BACK_DIR" >> sacommands.txt 
echo "dirserv:command = backupArchive" >> sacommands.txt 
/usr/sbin/serveradmin command < sacommands.txt 
rm sacommands.txt