<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 04/05/2012 09:27 AM, Mark Reynolds wrote:
    <blockquote cite="mid:4F7DB9DA.3010409@redhat.com" type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      Hi Brett,<br>
      <br>
      I think running the ldapsearch, and checking for error 32 is the
      easiest option.  <br>
    </blockquote>
    That should work, but if that's still not sufficient, if you create
    your own task entry, you can use the "ttl" attribute to set the time
    to live after the task is completed<br>
<a class="moz-txt-link-freetext" href="http://docs.redhat.com/docs/en-US/Red_Hat_Directory_Server/9.0/html/Configuration_Command_and_File_Reference/Core_Server_Configuration_Reference.html#cn-tasks-attributes">http://docs.redhat.com/docs/en-US/Red_Hat_Directory_Server/9.0/html/Configuration_Command_and_File_Reference/Core_Server_Configuration_Reference.html#cn-tasks-attributes</a><br>
    <blockquote cite="mid:4F7DB9DA.3010409@redhat.com" type="cite"> <br>
      I know you're not hitting this, but there are times when the task
      will stick around for a minute after its completed.  In that case,
      you can search for the task, and request the attribute
      "nsTaskStatus".  Then grep the value for "Backup finished", or
      "Backup failed".<br>
      <br>
      Regards,<br>
      Mark <br>
      <br>
      On 04/05/2012 08:22 AM, MATON Brett wrote:
      <blockquote
        cite="mid:20120405122252.86B5E40AA6@lists.fedoraproject.org"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=UTF-8">
        <meta name="Generator" content="Microsoft Word 12 (filtered
          medium)">
        <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
        <div class="WordSection1">
          <p class="MsoNormal"><span style="color:#1F497D">Oops, the
              ldapsearch –b is wrong I think the search should be<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">ldapsearch -x -H ${HOST} -D
              ${BINDAS} -b '</span> <span
              style="font-family:&quot;Courier New&quot;;color:#1F497D">cn=backup,cn=tasks,cn=config'

              -y ${PWFILE} 'cn=&lt;tasked&gt;'<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D">In short, if
              I immediately start the tar task after running db2bak.pl
              in my script, the target backup directory doesn’t exist.<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D">So I need to
              check if the backup task has finished.<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D">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’).<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
          <div>
            <div style="border:none;border-top:solid #B5C4DF
              1.0pt;padding:3.0pt 0cm 0cm 0cm">
              <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"
                    lang="EN-US">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"
                  lang="EN-US"> <a moz-do-not-send="true"
                    class="moz-txt-link-abbreviated"
                    href="mailto:389-users-bounces@lists.fedoraproject.org">389-users-bounces@lists.fedoraproject.org</a>
                  [<a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    href="mailto:389-users-bounces@lists.fedoraproject.org">mailto:389-users-bounces@lists.fedoraproject.org</a>]
                  <b>On Behalf Of </b>MATON Brett<br>
                  <b>Sent:</b> 05 April 2012 14:10<br>
                  <b>To:</b> General discussion list for the 389
                  Directory server project.<br>
                  <b>Subject:</b> Re: [389-users] How to tell when
                  database backup has finished?<o:p></o:p></span></p>
            </div>
          </div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Bit of a
              fiddle:<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D">Execute the
              d2bak.pl script in verbose mode and extract the task name:<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">task=$(${BACKUPCMD} -v -D
              "${BINDAS}" ${BACKUPOPTS} -a ${DSBACKUPDIR} 2&gt;
              /dev/null | grep "^adding new entry" )<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">ERR=$?<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">task=${task#*\"}<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">taskDN=${task%?}<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D">Syslog
              message and exit if script failed:<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">if [ $ERR -ne 0 ]; then<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">        LogIt "FAILED (${ERR})."
              "user.err";<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">        exit 1;<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">fi<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D">Until “task”
              isn’t found ( 32 ) hang around here....:<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">while [ ${ERR} != 32 ]; do<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">        (ldapsearch -x -H ${HOST}
              -D ${BINDAS} -b '${taskDN}' -y ${PWFILE} &gt; /dev/null
              2&gt;&amp;1 )<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">        ERR=$?<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">        if [ ${ERR} != 32 ]; then<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">                sleep 5s<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">        fi<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-family:&quot;Courier
              New&quot;;color:#1F497D">done<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D">Again any
              thoughts welcomed.<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D">Brett<o:p></o:p></span></p>
          <p><span
style="font-size:7.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:gray">-------------------------------------------------------------------</span><span
              style="color:gray"><o:p></o:p></span></p>
          <p class="MsoNormal"><strong><span
style="font-size:7.5pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#669933">GreeNRB</span></strong><b><span
style="font-size:7.5pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#669933"><br>
              </span></b><em><span
style="font-size:7.5pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#669933">NRB

                considers its environmental responsibility and goes for
                green IT.</span></em><span
style="font-size:7.5pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#669933">
              <br>
              <i>May we ask you to consider yours before printing this
                e-mail? </i><b> </b></span><span style="color:gray"> <o:p></o:p></span></p>
          <p class="MsoNormal"><b><span
style="font-size:7.5pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#000066">NRB,

                daring to commit <br>
              </span></b><i><span
style="font-size:7.5pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#000066">This

                e-mail and any attachments, which may contain
                information that is confidential and/or protected by
                intellectual property rights, are intended for the
                exclusive use of the above-mentioned addressee(s). Any
                use (including reproduction, disclosure and whole or
                partial distribution in any form whatsoever) of their
                content is prohibited without prior authorization of
                NRB. If you have received this message by error, please
                contact the sender promptly by resending this e-mail
                back to him (her), or by calling the above number. Thank
                you for subsequently deleting this e-mail and any files
                attached thereto.</span></i><span style="color:gray"><o:p></o:p></span></p>
        </div>
        <!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"-->
        <meta name="GENERATOR" content="TX_HTML32 11.0.211.501">
        <span style="FONT-FAMILY: 'Verdana'; COLOR: #808080; FONT-SIZE:
          7pt">
          <p><span style="FONT-FAMILY: 'Verdana'; COLOR: #808080;
              FONT-SIZE: 7pt">-------------------------------------------------------------------</span></p>
          <span style="FONT-FAMILY: 'Verdana'; COLOR: #808080;
            FONT-SIZE: 6pt">
            <p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><font
                face="tahoma,arial,helvetica,sans-serif"><font size="1"><font
                    color="#669933"><span style="FONT-FAMILY: "
                      lang="EN-GB"><strong>GreeNRB<br>
                      </strong><em>NRB considers its environmental
                        responsibility and goes for green IT.</em> <br>
                    </span><i><span style="FONT-FAMILY: " lang="EN-GB">May

                        we ask you to consider yours before printing
                        this e-mail? </span></i><b><span
                        style="FONT-FAMILY: " lang="EN-GB"> </span></b></font></font></font>
            </p>
            <p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><font
                face="tahoma,arial,helvetica,sans-serif"><font size="1"><font
                    color="#000066"><b><span style="FONT-FAMILY: "
                        lang="EN-GB">NRB, daring to commit <br>
                      </span></b><i><span style="FONT-FAMILY: "
                        lang="EN-GB">This e-mail and any attachments,
                        which may contain information that is
                        confidential and/or protected by intellectual
                        property rights, are intended for the exclusive
                        use of the above-mentioned addressee(s). Any use
                        (including reproduction, disclosure and whole or
                        partial distribution in any form whatsoever) of
                        their content is prohibited without prior
                        authorization of NRB. If you have received this
                        message by error, please contact the sender
                        promptly by resending this e-mail back to him
                        (her), or by calling the above number. Thank you
                        for subsequently deleting this e-mail and any
                        files attached thereto.</span></i></font></font></font></p>
          </span></span> <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">--
389 users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:389-users@lists.fedoraproject.org">389-users@lists.fedoraproject.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://admin.fedoraproject.org/mailman/listinfo/389-users">https://admin.fedoraproject.org/mailman/listinfo/389-users</a></pre>
      </blockquote>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--
389 users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:389-users@lists.fedoraproject.org">389-users@lists.fedoraproject.org</a>
<a class="moz-txt-link-freetext" href="https://admin.fedoraproject.org/mailman/listinfo/389-users">https://admin.fedoraproject.org/mailman/listinfo/389-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>