<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Marcus,<br>
    <br>
      Something like this should do you:<br>
    <br>
    RULE 'setxattr' LIST 'do_setxattr'<br>
    FOR FILESET ('xattrfileset')<br>
    WEIGHT(DIRECTORY_HASH)<br>
    ACTION(SETXATTR('user.testflag1','projectX'))<br>
    WHERE<br>
        KB_ALLOCATED >  [insert required file size limit] <br>
    <br>
    <br>
    Then with one file larger and another file smaller than the limit:<br>
    <br>
    root@elmo:/mmfs1/policies# getfattr -n user.testflag1
    /mmfs1/data/xattrfileset/*<br>
    getfattr: Removing leading '/' from absolute path names<br>
    # file: mmfs1/data/xattrfileset/file.1<br>
    user.testflag1="projectX"<br>
    <br>
    /mmfs1/data/xattrfileset/file.2: user.testflag1: No such attribute<br>
    <br>
    <br>
    As xattrs are a superb way of automating data operations, for those
    of you with our Python API have a look over the xattr examples in
    the git repo: <a class="moz-txt-link-freetext" href="https://github.com/arcapix/gpfsapi-examples">https://github.com/arcapix/gpfsapi-examples</a> as an
    alternative Pythonic way to achieve this.<br>
    <br>
    Cheers,<br>
    <br>
    Jez<br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 22/11/17 03:13, Marcus Koenig wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKgu3g4bhAJW4YYcoGAoC_GXC2nT3BfMXiALYia+2tfCqSKUtw@mail.gmail.com">
      <div dir="ltr">Hi there,
        <div><br>
        </div>
        <div>I've got a question around setting userdefined extended
          attributes. I have played around a bit with setting certain
          attributes via mmchattr - but now I want to run a policy to do
          this for me for certain filesets or file sizes.<br>
        </div>
        <div><br>
        </div>
        <div>How would I write my policy to set an attribute like
          user.testflag1=projectX on a number of files in a fileset that
          are bigger than 1G for example?</div>
        <div><br>
        </div>
        <div>Thanks folks.</div>
        <div><br>
        </div>
        <div>Cheers,</div>
        <div>Marcus</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>
          Head of Research and Development, Pixit Media<br>
          07764193820 <font color="#FF0000">|</font> <a
            href="mailto:jtucker@pixitmedia.com">jtucker@pixitmedia.com</a><br>
          <a href="http://www.pixitmedia.com">www.pixitmedia.com</a> <font
            color="#FF0000">|</font> <a
            href="https://twitter.com/PixitMedia">Tw:@pixitmedia.com</a><br>
        </font>
      </div>
    </div>
  </body>
</html>

<br>
<div><a href="mailto:info@pixitmedia.com" target="_blank"><img src="http://pixitmedia.com/sig/pixitmedia-9-2018.png"></a><br><font face="Arial, Helvetica, sans-serif" size="1">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.</font></div>