<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi Owen,<br>
    <br>
      This is a great thread and raises as is usual with GPFS that there
    is more often than not many tools in the bag and more than one way
    to achieve a requirement.<br>
    <br>
    If you stick with policy (indeed worthwhile aspect of GPFS to learn
    well) you can also build up libraries of centralised macros and
    reference them into any policy file alike so at the top of the file:<br>
    <br>
    include(/mmfs1/policies/macros/general_macros.m4)<br>
    include(/mmfs1/policies/macros/pixit_excludes.m4)<br>
    <br>
    Check your PixStor system under /mmfs1/policies/..<br>
    <br>
    The .m4 extension is not required, but a nod to
    <a class="moz-txt-link-freetext" href="https://www.gnu.org/savannah-checkouts/gnu/m4/manual/m4-1.4.18/m4.html">https://www.gnu.org/savannah-checkouts/gnu/m4/manual/m4-1.4.18/m4.html</a>
    which the policy engine also encapsulates.  Marc Kaplan once told me
    "You can do just about anything with m4 and cleverness and
    patience...", though he failed to mention the required amounts of
    coffee and pizza ;-)  Search the list digests for his valuable
    insights over the years.<br>
    <br>
    Alternatively you can achieve all this and more using the Python API
    <a class="moz-txt-link-freetext" href="https://www.arcapix.com/pixstorapi/index.html">https://www.arcapix.com/pixstorapi/index.html</a> (especially your date
    processing).<br>
    <br>
    If you'd like direct support with any this, ping us over an email
    via support@ - alternatively there are indeed many great minds a
    wealth of experience and views on this list (and it's nice to meet
    the community too).<br>
    <br>
    SSUG also has a Slack channel too.. ssug-poweraiug.slack.com<br>
    <br>
    Most of all - have fun learning.<br>
    <br>
    <br>
    Kind regards,<br>
    <br>
    Jez<br>
    <br>
    p.s. yes the threading has all gone wonky. ah well :-)<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 01/02/2021 21:09, Owen Morgan wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:VI1PR09MB399866E19B20148A64B4FF5488B69@VI1PR09MB3998.eurprd09.prod.outlook.com"><!--[if (gte mso 9)|(IE)]><style type="text/css">.main-style-5f6884540e9db9716d22 { font-family: sans-serif; font-size: 11pt; /* inherit */ }</style><![endif]-->
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div style="/* inherit */" class="main-style-5f6884540e9db9716d22">
        <div>Jonathan,</div>
        <div><br>
        </div>
        <div>If I have a single policy file with all the related
          department rules and each time they want to add additional
          rules with different working day thresholds maybe using this
          -M method is easier. Its clear that the 'maths' and
          date/timestamp manipulation is easier in shell (my preferred
          is bash) than in the SQL of the policy (your example is
          succinct but needs to be repeated everytime a new rule is
          added with a different working day threshold, which is what
          I'm trying (if possiblr) to avoid.</div>
        <div><br>
        </div>
        <div>It seems to me the IBM SQL engine is perhaps missing more
          'SQL' in built date/time functions like DateAdd and DateDiff
          etc..  as this would be a moot point. Its a shame I can't make
          one function that given a working day input as an argument
          spits out how many 'real' days exist between them for the file
          age comparison all in the SQL. It can be done for 1 specific
          input argument, but needs the whole function repeated manually
          for a different input argument, and further repeated for a
          different argument etc..</div>
        <div><br>
        </div>
        <div>Maybe I'm also compounding the issue by trying to make the
          policy file as concise as possible (for sake of clarity as to
          what the rules are trying to achieve, and easy expandability),
          and demanding too much of the SQL-like syntax that IBM have
          created.</div>
        <div><br>
        </div>
        <div>I have options for mmfind or even (as suggested) -M inoput
          to mmapplypolicy where I us bash to create a small function
          that does what I need, spits out 'real days' given a working
          day input, and using arrays and for-loop create a dynamic
          calling of the mmapplypolicy command (which I'm kinda half
          doing anyways for other reasons in my launcher script.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>As always, I'm seriously amazed at people with soo much
          experience and knowledge taking time out to help, guide, and
          offer input like everyone has been doing!! I'm relatively
          early in my career, so being able to interact and learn from
          experienced persons is giving me such a wider insight!</div>
        <div><br>
        </div>
        <div>Thanks!</div>
        <div><br>
        </div>
        <div>Owen.</div>
      </div>
      <img alt="Sent from Front" aria-hidden="true" style="width: 1px;
        height: 1px"
src="https://app.frontapp.com/api/1/noauth/companies/lansat/seen/msg_9ceuouc/0/6e6ba5d7.gif"
        moz-do-not-send="true"><br>
      <div
        style="mso-line-height-rule:exactly;-webkit-text-size-adjust:100%;">
        <table style="width:100%;" cellspacing="0" cellpadding="0"
          border="0">
          <tbody>
            <tr style="font-size:0;">
              <td style="vertical-align:top;" align="left">
                <table style="font-size:0;line-height:normal;"
                  cellspacing="0" cellpadding="0" border="0">
                  <tbody>
                    <tr style="font-size:0;">
                      <td style="padding:0;"> </td>
                      <td style="padding:10px 0 0;"> </td>
                    </tr>
                    <tr style="font-size:0;">
                      <td style="padding:0 4px 0
                        0;border-top:none;border-right:solid 1px
                        #FFCC00;border-bottom:none;border-left:none;vertical-align:middle;"
                        align="left"><img
src="http://www.motionpicturesolutions.com/wp-content/uploads/2018/06/MPSEmail.jpg"
                          alt=""
                          style="height:91px;min-height:91px;max-height:91px;font-size:0;"
                          moz-do-not-send="true" height="91" border="0"></td>
                      <td style="padding:10px 0 10px
                        10px;vertical-align:middle;" align="left">
                        <table
style="width:100%;font-size:0;font-style:normal;font-weight:700;white-space:nowrap;"
                          cellspacing="0" cellpadding="0" border="0">
                          <tbody>
                            <tr style="font-size:12px;color:#FFCC00;">
                              <td
                                style="vertical-align:top;font-family:Calibri,Arial,sans-serif;"
                                align="left">Owen Morgan<span
style="font-family:remialcxesans;font-size:1px;color:#FFFFFF;line-height:1px;">​</span></td>
                            </tr>
                            <tr style="font-size:10.67px;color:#232323;">
                              <td
                                style="vertical-align:top;font-family:Calibri,Arial,sans-serif;"
                                align="left">Data Wrangler</td>
                            </tr>
                            <tr style="font-size:10.67px;color:#232323;">
                              <td
                                style="vertical-align:top;font-family:Calibri,Arial,sans-serif;"
                                align="left">Motion Picture Solutions Ltd</td>
                            </tr>
                            <tr style="font-size:0;">
                              <td style="vertical-align:top;"
                                align="left">
                                <table style="font-size:0;"
                                  cellspacing="0" cellpadding="0"
                                  border="0">
                                  <tbody>
                                    <tr style="font-size:0;">
                                      <td style="padding:10px 0
                                        0;vertical-align:top;"
                                        align="left">
                                        <table
style="font-size:0;color:#232323;font-style:normal;font-weight:400;white-space:nowrap;"
                                          cellspacing="0"
                                          cellpadding="0" border="0">
                                          <tbody>
                                            <tr
                                              style="font-size:10.67px;">
                                              <td
                                                style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;"
                                                align="left"><span
                                                  style="font-weight:700;">T:</span> <a
                                                  href="tel:"
                                                  target="_blank"
                                                  id="LPlnk689713"
                                                  style="text-decoration:none;color:#232323;"
                                                  moz-do-not-send="true"><strong
style="font-weight:400;"></strong></a></td>
                                            </tr>
                                          </tbody>
                                        </table>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                              </td>
                            </tr>
                            <tr style="font-size:0;">
                              <td style="vertical-align:top;"
                                align="left">
                                <table
style="font-size:0;color:#232323;font-style:normal;font-weight:400;white-space:nowrap;"
                                  cellspacing="0" cellpadding="0"
                                  border="0">
                                  <tbody>
                                    <tr style="font-size:10.67px;">
                                      <td
                                        style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;"
                                        align="left"><span
                                          style="font-weight:700;">E:</span> <a
href="mailto:owen.morgan@motionpicturesolutions.com" target="_blank"
                                          id="LPlnk689713"
                                          style="text-decoration:none;color:#232323;"
                                          moz-do-not-send="true"><strong
                                            style="font-weight:400;">owen.morgan@motionpicturesolutions.com</strong></a></td>
                                      <td
style="vertical-align:middle;font-size:12px;color:#FED400;font-family:Calibri,Arial,sans-serif;"
                                        align="center"> | </td>
                                      <td
style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;font-weight:700;"
                                        align="left">W: <span
                                          style="font-weight:400;"><a
                                            href="https://www.motionpicturesolutions.com/"
                                            target="_blank"
                                            id="LPlnk689713"
                                            style="text-decoration:none;color:#232323;"
                                            moz-do-not-send="true"><strong
                                              style="font-weight:400;">motionpicturesolutions.com</strong></a></span></td>
                                    </tr>
                                  </tbody>
                                </table>
                              </td>
                            </tr>
                            <tr style="font-size:0;">
                              <td style="vertical-align:top;"
                                align="left">
                                <table
style="font-size:0;color:#232323;font-style:normal;font-weight:400;white-space:nowrap;"
                                  cellspacing="0" cellpadding="0"
                                  border="0">
                                  <tbody>
                                    <tr style="font-size:10.67px;">
                                      <td
style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;font-weight:700;"
                                        align="left">A: </td>
                                      <td
                                        style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;"
                                        align="left">Mission Hall, 9‑11 North End Road</td>
                                      <td
                                        style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;"
                                        align="left">, </td>
                                      <td
                                        style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;"
                                        align="left">London</td>
                                      <td
                                        style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;"
                                        align="left">, </td>
                                      <td
                                        style="vertical-align:middle;font-family:Calibri,Arial,sans-serif;"
                                        align="left">W14 8ST<br>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
            </tr>
            <tr style="font-size:0;">
              <td style="vertical-align:top;" align="left">
                <table style="width:100%;font-size:0;" cellspacing="0"
                  cellpadding="0" border="0">
                  <tbody>
                    <tr style="font-size:0;">
                      <td style="padding:10px 0 0;vertical-align:top;"
                        align="left">
                        <table
style="white-space:normal;color:#C0C0C0;font-size:14.67px;font-family:Calibri,Arial,sans-serif;font-weight:400;font-style:normal;text-align:justify;width:100%;"
                          cellspacing="0" cellpadding="0" border="0">
                          <tbody>
                            <tr style="font-size:10.67px;">
                              <td
                                style="font-family:Calibri,Arial,sans-serif;">Motion
                                Picture Solutions Ltd is a company
                                registered in England and Wales under
                                number 5388229, VAT number 201330482</td>
                            </tr>
                          </tbody>
                        </table>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <blockquote type="cite" class="front-blockquote">On 1 February
        2021, 20:17 GMT <a href="mailto:jonathan.buzzard@strath.ac.uk"
          target="_blank" rel="noopener noreferrer"
          moz-do-not-send="true">
          jonathan.buzzard@strath.ac.uk</a> wrote:<br>
        <br>
        On 01/02/2021 18:11, Jan-Frode Myklebust wrote:
        <blockquote type="cite" class="front-blockquote"><br>
          > CAUTION: This email originated outside the University.
          Check before <br>
          > clicking links or attachments.<br>
          > Agree.. Write a policy that takes a "mmapplypolicy -M
          var=val" argument, <br>
          > and figure out the workdays outside of the policy.
          Something like:<br>
          > <br>
          > # cat test.poilcy<br>
          > define( access_age,     (DAYS(CURRENT_TIMESTAMP) -
          DAYS(ACCESS_TIME)))<br>
          > /* list migrated files */<br>
          > RULE EXTERNAL LIST 'oldFiles' EXEC ''<br>
          > RULE 'oldFiles' LIST 'oldFiles'<br>
          >     WHERE (access_age > MINAGE)<br>
          > <br>
          > # mmapplypolicy gpfs01  -P test.policy -I defer -f
          ./filelist -M MINAGE=5<br>
          > <br>
          <br>
          Why bother when you can do it all in the policy?<br>
          <br>
          JAB.<br>
          <br>
          -- <br>
          Jonathan A. Buzzard Tel: +44141-5483420<br>
          HPC System Administrator, ARCHIE-WeSt.<br>
          University of Strathclyde, John Anderson Building, Glasgow. G4
          0NG<br>
          <br>
        </blockquote>
      </blockquote>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
<a class="moz-txt-link-freetext" href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss">http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a>
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <div>
        <font face="arial" color="#000000">
          <b>Jez Tucker</b><br>
          VP Research and Development <font color="#BD1C1A">|</font>
          Pixit Media<br>
          m: +44 (0) 776 419 3820<br>
          e: <a href="mailto:jtucker@pixitmedia.com">jtucker@pixitmedia.com</a><br>
          Visit <a href="https://www.pixitmedia.com">www.pixitmedia.com</a>
        </font>
      </div>
    </div>
  </body>
</html>

<br>
<div style="font-family:"Times New Roman";font-size:medium"><span style="color:silver;font-family:Arial;font-size:0.625em"><br></span></div><div style="font-family:"Times New Roman";font-size:medium"><span style="color:silver;font-family:Arial;font-size:0.625em">This email is confidential in that it is intended for the exclusive attention of the addressee(s) indicated. If you are not the intended recipient, this email should not be read or disclosed to any other person. Please notify the sender immediately and delete this email from your computer system. Any opinions expressed are not necessarily those of the company from which this email was sent and, whilst to the best of our knowledge no viruses or defects exist, no responsibility can be accepted for any loss or damage arising from its receipt or subsequent use of this email.</span></div>