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

Re: Help

On Mon, Feb 25, 2002 at 06:42:54AM +0100, Philippe BEAU wrote:
> Thanks a lot
> i just want to know if my method is good ;)) We have to pay for a LDAP
> Directory in our alcatel, but i found the system LDAP which is quite good
> for me ... ;))
> is anyone have a sample script of replication via a cron ? ;))

Dang.  I got laid off from my last job, so I'd have to dig up this nifty
LDAP->LDAP replication script I came up with.  There are others out
there, tough.  I had to write my own script because the two systems used
different schemas, and I had to munge stuff when synchronizing data
between them.

The general algorithm goes like this:

For each entry on server a:
 - Determine if corresponding entry exists on server b.
   - Create a new entry, if necessary.
 - Based on data in server a, determine what entry on server b should
   look like.
   - Update server b's entry, if necessary.

You might have to look through server b for entries that do not exist on
server a, and delete them.

I have two different Perl scripts that use the two different Perl LDAP
modules, that might be handy for parts:


They both compare an LDAP data source and update another data source if
need be, although they iterate through the "slave"s entries instead of
following the above algorithm.