#!/usr/bin/expect -f # # Backup OpenDirectory, including LDAP database and Kerberos configuration # Copyright (c)2010 Barton IT-Consulting & maccc # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU General Public License for more details. # set date [timestamp -format "%Y-%m-%d"] set archive_password "apple" set archive_name "OD-" spawn /usr/sbin/slapconfig -backupdb $archive_name$date expect "Enter archive password" send "$archive_password\r" expect eof