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

Re: backup (was: slapcat cannot open database - why?)



Hi Kurt, Hi Roland,

we use a simple script that shutsdown the LDAP server for just 2 seconds
every 12h, copy the directories to a backup dir and restarts the server.

After the Script you could do a ldbmcat on the backuped dir which is always
offline.

##### Start Script on Compaq ProLiant DL360, SuSE 7.0 linux kernel 2.2.16,
OpenLDAP 1.2.11

#!/bin/sh

SLAPD_CONF="/etc/openldap/slapd.conf"
ORIGIN="ldap"
BACKUP="ldap.backup"

rcldap stop

for db in `cat $SLAPD_CONF | grep ^directory | cut -f 2`; do
 db_backup=`echo "$db" | sed -e "s,$ORIGIN,$BACKUP,g"`
 mkdir -m 0700 -p $db_backup
 echo "Creating Backup of $db in `dirname $db_backup`"
 cp -rpf $db `dirname $db_backup`
done

rcldap start

###### End Script

Roland Rosenfeld schrieb:

> Hi Kurt!
>
> On Wed, 17 Jan 2001, Kurt D. Zeilenga wrote:
>
> > >    slapcat: could not open database.
>
> > Make sure slapd is not running.
>
> Ah, many thanks, that helped.
>
> But this doesn't help me with my initial problem: I want to backup the
> LDAP server.  Is it safe to backup the gdbm files only?  I personally
> would prefer to backup a LDIF file, which can also be used on a
> machine with a different hardware architecture.  That's why I was
> looking for slapcat.  But on a production machine I cannot stop slapd
> while running slapcat, because the server needs to be available all
> the time.
>
> So my new question is: how do you backup the data of your LDAP servers?
>
> Tschoeeee
>
>         Roland

--
Dirk Datzert

Rasselstein Hoesch GmbH
Informatik / Anwendungsentwicklung
D-56626 Andernach
Koblenzer Strasse 141

http://www.rasselstein-hoesch.de

Tel.: +49 (0) 2631 81-4595
Fax.: +49 (0) 2631 81-15-4595
mailto:Dirk.Datzert@rasselstein-hoesch.de

begin:vcard 
n:Datzert;Dirk
tel;cell:+49 (0) 170 9017165
tel;fax:+49 (0) 2631 81-15-4595
tel;home:+49 (0) 2631 25460
tel;work:+49 (0) 2631 81-4595
x-mozilla-html:TRUE
url:www.rasselstein-hoesch.de
org:Rasselstein Hoesch GmbH;Informatik / Anwendungsentwicklung
adr:;;Koblenzer Straße 141;Andernach;Rheinland-Pfalz;56626;Germany
version:2.1
email;internet:Dirk.Datzert@Rasselstein-Hoesch.de
x-mozilla-cpt:;21456
fn:Dirk Datzert
end:vcard

Attachment: smime.p7s
Description: Kryptographische Unterschrift mit S/MIME