cd /
dir_backup "etc" "etc"
dir_backup "root" "root"
+ if [[ -d "opt/fbrehm" ]] ; then
+ dir_backup "opt/fbrehm" "opt-fbrehm"
+ fi
+ if [[ -d "var/bind" ]] ; then
+ dir_backup "var/bind" "var-bind"
+ fi
dir_backup "var/lib" "var-lib"
dir_backup "var/log" "var-log"
dir_backup "var/spool/cron" "var-spool-cron"
}
+#------------------------------------------------------------------------------
+do_backup_ldap() {
+
+ local dumpfile="${BACKUP_DIR}/ldap.dump.ldif.gz"
+
+ if ps -ef | grep slapd | grep -v grep >/dev/null ; then
+ :
+ else
+ debug "OpenLDAP Server is not running."
+ return
+ fi
+
+ empty_line
+ info "Dumping OpenLDAP Datenbank -> '${CYAN}${dumpfile}${NORMAL}' ..."
+
+ local cmd="ldapsearch -D \"${LDAP_DN}\" -x -h localhost"
+ if [[ "${VERBOSE}" == "y" ]] ; then
+ cmd+=" --verbose"
+ fi
+ cmd+=" -z 10000 -w \"${LDAP_PW}\" -b \"${LDAP_SEARCH_BASE}\""
+ cmd+=" | gzip -9"
+ if [[ "${VERBOSE}" == "y" ]] ; then
+ cmd+=" --verbose"
+ fi
+ cmd+=" > \"${dumpfile}\""
+ if [[ "${SIMULATE}" == "y" ]] ; then
+ info "Executing: ${cmd}"
+ return
+ fi
+ debug "Executing: ${cmd}"
+ eval ${cmd}
+ debug "Finished LDAP dump."
+
+}
+
+
#------------------------------------------------------------------------------
create_checksums() {
if [[ "${DO_POSTGRES}" == "y" ]] ; then
do_postgres_backup
fi
+ do_backup_ldap
create_checksums
clean_old_backups
sync_to_remote