## ldapadd without being reordered.
##
-## backupdir (default /var/backups/ldap): the destination for the backups
+## backupdir (default /var/backups/ldap): the destination for the backups.
+## This variable is interpolated, see backup.d (5) for which variables are
+## available.
# backupdir = /var/backups/ldap
## conf (default /etc/ldap/slapd.conf): the location of the slapd.conf file.
vexec="$VSERVER $vsname exec"
fi
+ dumpdir=`interpolate "$backupdir" "$vsname"`
+ info "Backing up to dir '$dumpdir'"
+
[ -f $vdir$conf ] || fatal "slapd config file ($conf) not found"
- [ -d $backupdir ] || mkdir -p $backupdir
- [ -d $backupdir ] || fatal "Backup directory '$backupdir'"
+ [ -d $dumpdir ] || mkdir -p $dumpdir
+ [ -d $dumpdir ] || fatal "Backup directory '$dumpdir'"
dbsuffixes=(`@AWK@ 'BEGIN {OFS=":"} /[:space:]*^database[:space:]*\w*/ {db=$2}; /^[:space:]*suffix[:space:]*\w*/ {if (db=="bdb"||db=="hdb"||db="ldbm") print db,$2}' $vdir$conf|@SED@ -e 's/[" ]//g'`)
## LDIF DUMP
if [ "$ldif" == "yes" ]; then
- dumpdir="$backupdir"
- [ -d $dumpdir ] || mkdir -p $dumpdir
-
if [ "$databases" == 'all' ]; then
dbcount=`grep '^database' $vdir$conf | wc -l`
let "dbcount = dbcount - 1"