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

Re: openldap db wiped?



I've opened a thread with same problem in last November.

http://www.openldap.org/lists/openldap-software/200412/msg00080.html

The last advise was: "Set a crontab script that runs db_checkpoint in
every 5 minutes." This forces to write bdb logs to disk.

Here is mine: (I've found it on the net. :-))

DBCHKPOINT=/usr/local/BerkeleyDB.4.2/bin/db_checkpoint

for dbdir in `awk '/^[:space:]*directory[:space:]*\w*/ {print $2}' /etc/ldap/slapd.conf`
  do
    if [ -n "`find ${dbdir}/*.bdb 2>&-`" ]
                then
                        if [ -n "$DBCHKPOINT" ]
                        then
                                printf "Running %s on %s\n" "$DBCHKPOINT" "${dbdir}"
                                $DBCHKPOINT -v -1 -h ${dbdir} 2>&1 >/dev/null
                        else
                                printf "Warning: no db_checkpoint available for %s\n" ${dbdir}
                        fi
                fi
done

-- 

Szuts Attila    Linux Support Center Kft.
Email: aszuts@lsc.hu