# Automated backups of Open Directory databases (ldap / kerberos / password server) # This needs to run as root and should be mode 700 due to embedded password # Get current date TODAY=`/bin/date +'%m-%d-%y_%H:%M:%S'` # Set destination directory (do not include trailing slash!) DSTDIR=/path/to/backups # Set archive password (needed to restore from / unlock the resulting dmg) PASS="the_foo" # Feed a heredoc to serveradmin /usr/sbin/serveradmin command <<EOF dirserv:backupArchiveParams:archivePassword = $PASS dirserv:backupArchiveParams:archivePath = $DSTDIR/od_backup_$TODAY dirserv:command = backupArchive EOF
Something to say?
You must be logged in to post a comment.