Oops, the ldapsearch –b is wrong I think the search should be ldapsearch -x -H ${HOST} -D ${BINDAS} -b ' cn=backup,cn=tasks,cn=config' -y ${PWFILE} 'cn=<tasked>' In short, if I immediately start the tar task after running db2bak.pl in my script, the target backup directory doesn’t exist. So I need to check if the backup task has finished. The DB is so small here though that that task has finished ( and the task deleted ) before I can run an ldapsearch to check the base and filter (even if I put it in the script before ‘tar’). From: 389-users-bounces@xxxxxxxxxxxxxxxxxxxxxxx [mailto:389-users-bounces@xxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of MATON Brett Bit of a fiddle: Execute the d2bak.pl script in verbose mode and extract the task name: task=$(${BACKUPCMD} -v -D "${BINDAS}" ${BACKUPOPTS} -a ${DSBACKUPDIR} 2> /dev/null | grep "^adding new entry" ) ERR=$? task=${task#*\"} taskDN=${task%?} Syslog message and exit if script failed: if [ $ERR -ne 0 ]; then LogIt "FAILED (${ERR})." "user.err"; exit 1; fi Until “task” isn’t found ( 32 ) hang around here....: while [ ${ERR} != 32 ]; do (ldapsearch -x -H ${HOST} -D ${BINDAS} -b '${taskDN}' -y ${PWFILE} > /dev/null 2>&1 ) ERR=$? if [ ${ERR} != 32 ]; then sleep 5s fi done Again any thoughts welcomed. Brett ------------------------------------------------------------------- GreeNRB NRB, daring to commit ------------------------------------------------------------------- GreeNRB NRB, daring to commit |
-- 389 users mailing list 389-users@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/389-users