[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Deleting a database



If you simply just need to delete your database I suggest you just 
delete the *.dbb files (for example if your using ldbm as your back-
end)

#!/bin/sh

MY_LDIF=/path/to/exchange.ldif

cd /path/to/slapd_dbb

# make a backup
if [ ! -d /path/to/backup_dir ];
then
  mkdir /path/to/backup_dir
fi

# move dbb files to backup dir
/bin/mv *.dbb /path/to/backup_dir

# run update
/usr/local/openldap/sbin/slapadd -l ${MY_LDIF} -
f /path/to/openldap/slapd.conf -c > /var/log/myoutput 2>&1
<wait a few...depending on size>

Not the most elegant but should get you started. Hope that helps

Jan-Michael


----- Original Message -----
From: "Pieter De Wit" <pieter@vodacom.co.za>
Date: Friday, January 10, 2003 8:18 pm
Subject: Deleting a database

> Hello Everyone,
> 
> I have tried to get hold of the General List, but can't seem to 
> get there.
> Sorry if this is off-topic.
> 
> I need to delete all entries in my ldap database (using a shell 
> script,something like ldapsearch/ldapdelete). I have a lot of 
> changes that happen
> to my database and once a week I would like to rebuild the 
> database. I
> import/process the data from another ldap server (exchange) so the 
> re-create
> isn't a big problem (but replication is.....).
> 
> Thanks,
> 
> Pieter De Wit
> 
>