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

Does slapadd return any sort of error handling when it fails to i mport an ldif file?



	Ok, I'm learning (OpenLDAP and Linux at the same time), but I'm
stumped again.  I can't find anything in the documentation, though it might
be there somewhere.  As stated previously, every day an LDIF file is created
from the Active Directory domain controller, with only the desired fields
exported to the ldif file.  Another script copies the ldif file to the
folder /data/openldaptemp and names the ldif file dump.ldif.  That is where
my script is supposed to pick up the ball and run with it.  My script is
supposed to stop the wipe the OpenLDAP database and import the dump.ldif
file.  I think I got it to do that properly.

	However, now I am supposed to add the following functionality -

1) Rename the dump.ldif file to "dump-(today's date).ldif" before importing
it
2) Delete any dump-mmddyyyy.ldif file older that a week
3) If slapadd reports an error, redo the import with the previous ldif file
4) If slapadd reports an error, alert the administrator in some manner

	What I'm posting this for is so I can find out if slapadd has any
error handling I can use for 3) and 4).  Thanx!


# This script shuts down the LDAP database, deletes the files,
# starts the database to initialize it, shuts it down again (to
# prevent damage to the database during the slapadd import), imports
# the LDIF file to recreate the database, and then finally
# starts the database again.

/etc/init.d/ldap stop
rm /data/duckpond.dol/*
/etc/init.d/ldap start
/etc/init.d/ldap stop
/usr/sbin/slapadd -l /data/openldaptemp/dump.ldif
/etc/init.d/ldap start