Installing And Configuring LDAP-UX Client Services

Download the Profile Periodically

Download the Profile Periodically

Setup allows you to define a time interval after which the current profile is being automatically refreshed. The start time for this periodic refresh is defined by the time the setup program was run and the value defined for ProfileTTL. Therefore, it does not allow you to define a specific time of day when the profile should be downloaded (refreshed). For more detailed information, refer to the ldapclientd(1) man page.

If you would like to manually control when you want to download the profile, you can use the following steps:

Step 1. When creating your profile entry using setup, set the ProfileTTL value to 0.

Step 2. Using the command get_profile_entry -s nss, write a shell script that downloads the profile. Below is an example that downloads the profile from the directory. Modify this example for your environment. It also compares the new and old profiles and emails a status message:

#!/bin/ksh

cp /etc/opt/ldapux/ldapux_profile.ldif /etc/opt/ldapux/ldapux_profile.sav /opt/ldapux/config/get_profile_entry -s nss 2>&1>/tmp/profile.upd$$

diff /etc/opt/ldapux/ldapux_profile.ldif /etc/opt/ldapux/ldapux_profile.sav\ >> /tmp/profile.upd$$

if [ -s /tmp/profile.upd$$ ]; then

cat /tmp/profile.upd$$ mailx -s "Profile cache refreshed." root@sys01

else

echo "No changes." mailx -s "Profile cache refreshed." root@sys01

fi

rm -f /etc/opt/ldapux/ldapux_profile.sav rm -f /tmp/profile.upd$$

Step

3.

Create a crontab(1) file (or edit your existing crontab file) and specify

 

 

how frequently you want the profile to be downloaded. For example,

 

 

assuming the script above is in the file /ldapux/download_ldap_profile,

 

 

the following crontab specification specifies that

 

 

/ldapux/download_ldap_profile be executed nightly at midnight:

0 0 * * * /ldapux/download_ldap_profile

Step

4.

Log in as root and schedule the job with the crontab(1) command. For

 

 

example, assuming the crontab entry above is in the file crontab.profile,

 

 

the following schedules the profile downloading:

74

Chapter 2

Page 88
Image 88
HP UX LDAP-UX Integration Software manual Download the Profile Periodically