Re: ispman bdb database howto ? Wim ?

Wim Kerkhoff <[email protected]> Wed, 18 May 2005 14:03:24 -0700
Newsgroups gmane.comp.isp.ispman.user
Message-ID <[email protected]>
Hi Ezio,

Ezio Paglia wrote:

> I tried to manage the value of  the cachesize, but with no results and 
> the same error.
> If I copy a new installation of ispman ldap over the /var/lib/ldap 
> directory, slapd works; so I think that the db files are actually 
> corrupted.
> Do you know a pratical way to manage them ?

Try:

 db4.2_recover -h /var/lib/ldap

The command may be slightly different depending on the version of the db 
tools that you have installed.

Once you have a working database, look at creating some backups :-)  
Because of all the problems and the inherit design problem of no audit 
trails in LDAP, I wrote a script to dump the database several times a 
day. Can be run as many times as desired, since it creates a timestamped 
file. This gets backed up locally, in addition to daily backups of the 
entire server.

Wim

#!/bin/bash

# this script creates very paranoid backups of the LDAP database
# by Wim Kerkhoff

FOLDER=`date +%Y/%m/%d`
FILE=`date +%H:%M:%S`
BASE=/home/system-backups/controller01/ldap
BZIP=/usr/bin/bzip2
SLAPCAT=/usr/sbin/slapcat
LDAPSEARCH=/usr/bin/ldapsearch

#echo "let's put it in: $FOLDER/$FILE"

mkdir -p $BASE/$FOLDER

killall ispman-agent
/etc/init.d/slapd stop
$SLAPCAT | $BZIP - > $BASE/$FOLDER/${FILE}.slapcat.dat.bz2
/etc/init.d/slapd start
#$LDAPSEARCH -x | $BZIP - > $BASE/$FOLDER/${FILE}.ldapsearch.dat.bz2
/etc/init.d/ispman-agent start




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click