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

Re: Question about backups



> I have seen quite a bit of information about using LDAP as the only
> source of user info for things like Apache, Sendmail, etc.  I think that
> it's great but how do you effectively keep the data backed up?  I have a
> small ldap database, and I am using tar every night to back up the
> system, but is this an effective means of back-up?  Are there any
> problems with open files (the database files)?
> 
> 
> Thanks,
> Chris Zimmerman
> 

I run the following nightly from cron. Note that I have do run into situations
where the ldbmcat fails, even though the database seems otherwise OK - I have
not got round to tracking these down yet. My LDAP database is not fully in
production yet. I feel more comfortable with a text backup, which can be
fed back into ldif2ldbm to create the databases from scratch (in theory)


	John Lines



#!/bin/sh

# Script to backup the ldap database daily 


cd /export/home/ldap

test -f backup.ldif.2 && mv backup.ldif.2 backup.ldif.3
test -f backup.ldif.1 && mv backup.ldif.1 backup.ldif.2
test -f backup.ldif.0 && mv backup.ldif.0 backup.ldif.1
test -f backup.ldif && mv backup.ldif backup.ldif.0

/usr/local/sbin/ldbmcat -n db/id2entry.dbb > backup.ldif

if [ $? -ne 0 ]; then
  ls -al | /bin/mailx -s "LDAP backup failed" john.lines@aeat.co.uk
fi

#