HP-UX Directory Server 8.1 administrator guide

This initiates replication toward the server that holds the information that needs to be updated.
8.11.2 Forcing replication updates from the command line
From the consumer that requires updating, run a script that prompts the supplier to send
replication updates immediately. This script is shown in Example 8-1 “Replicate_Now script
example”.
Copy this example script and name it something like replicate_now.sh. Substitute the actual
values for the variables listed in Example 8-1 “Replicate_Now script example”.
NOTE:
This script must be run manually because it cannot be configured to run automatically as soon
as the server, which was offline, comes back online again.
Example 8-1 Replicate_Now script example
#!/bin/sh
SUP_HOST=supplier_hostname
SUP_PORT=supplier_portnumber
SUP_MGRDN=supplier_directoryManager
SUP_MGRPW=supplier_directoryManager_password
MY_HOST=consumer_hostname
MY_PORT=consumer_portnumber
ldapsearch -1 -T -h ${SUP_HOST} -p ${SUP_PORT} -D "${SUP_MGRDN}" \
-w ${SUP_MGRPW} -b "cn=mapping tree, cn=config"
\"(&(objectclass=nsds5replicationagreement)(nsDS5ReplicaHost=${MY_HOST})
\(nsDS5ReplicaPort=${MY_PORT}))" dn nsds5ReplicaUpdateSchedule > /tmp/$$
cat /tmp/$$ |awk 'BEGIN { s = 0 }/^dn: / { print $0;print "changetype: modify";print
"replace: nsds5ReplicaUpdateSchedule";print "nsds5ReplicaUpdateSchedule: 0000-2359
0123456";print "-";print "";print $0;print "changetype: modify";
print "replace:nsds5ReplicaUpdateSchedule";}
/^nsds5ReplicaUpdateSchedule: / { s = 1; print $0; }/^$/{if ( $s == 1 ){ print "-" ;
print ""; }else{ print "nsds5ReplicaUpdateSchedule: 0000-2359 0123456";print "-" ;
print ""; };s = 0; }
' > /tmp/ldif.$$; echo "Ldif is in /tmp/ldif.$$"; echo
ldapmodify -c -h ${SUP_HOST} -p ${SUP_PORT} -D "${SUP_MGRDN}" -w ${SUP_MGRPW}
-f /tmp/ldif.$$
Table 8-4 Replicate_Now variables
DefinitionVariable
Host name of the supplier to contact for information on replication agreements
with the current consumer.
supplier_hostname
LDAP port in use on the supplier.
supplier_portnumber
DN of the privileged Directory Manager user on the supplier.
supplier_directoryManager
Password of the privileged Directory Manager user on the supplier.
supplier_directoryManager_password
Host name of the current consumer.
consumer_hostname
LDAP port in use on the consumer.
consumer_portnumber
For the update operation to occur over an SSL connection, modify the ldapmodify command
in the script with the appropriate parameters and values. For more information on the
ldapmodify command, see “Managing entries from the command line” and the HP-UX Directory
Server configuration, command, and file reference.
378 Managing replication