<html><body><p><font size="2">Here is a simple C function posted from comp.lang.c many years ago that works for</font><br><font size="2">a restricted range (year &gt; 1752) based on the algorithm I described earlier.</font><br><br><tt><br>dayofweek(y, m, d)<br>{<br> &nbsp; &nbsp;y -= m &lt; 3;<br> &nbsp; &nbsp;return (y + y/4 - y/100 + y/400 + &quot;-bed=pen+mad.&quot;[m] + d) % 7;<br>}</tt><br><font size="2">---</font><br><font size="2">Madhav</font><br><img width="16" height="16" src="cid:1__=8FBB0CFFDFD6B9BC8f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for gpfsug-discuss-request---01/29/2021 07:00:11 AM---Send gpfsug-discuss mailing list submissions to  gp"><font size="2" color="#424282">gpfsug-discuss-request---01/29/2021 07:00:11 AM---Send gpfsug-discuss mailing list submissions to  gpfsug-discuss@spectrumscale.org</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">gpfsug-discuss-request@spectrumscale.org</font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">gpfsug-discuss@spectrumscale.org</font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">01/29/2021 07:00 AM</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">[EXTERNAL] gpfsug-discuss Digest, Vol 108, Issue 20</font><br><font size="2" color="#5F5F5F">Sent by:        </font><font size="2">gpfsug-discuss-bounces@spectrumscale.org</font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><tt><font size="2">Send gpfsug-discuss mailing list submissions to<br>                 gpfsug-discuss@spectrumscale.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>                 </font></tt><tt><font size="2"><a href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss">http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a></font></tt><tt><font size="2">&nbsp;<br>or, via email, send a message with subject or body 'help' to<br>                 gpfsug-discuss-request@spectrumscale.org<br><br>You can reach the person managing the list at<br>                 gpfsug-discuss-owner@spectrumscale.org<br><br>When replying, please edit your Subject line so it is more specific<br>than &quot;Re: Contents of gpfsug-discuss digest...&quot;<br><br><br>Today's Topics:<br><br> &nbsp; 1. Re: gpfsug-discuss Digest, Vol 108, Issue 18 (Uwe Falke)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Thu, 28 Jan 2021 20:54:38 +0100<br>From: &quot;Uwe Falke&quot; &lt;UWEFALKE@de.ibm.com&gt;<br>To: gpfsug main discussion list &lt;gpfsug-discuss@spectrumscale.org&gt;<br>Subject: Re: [gpfsug-discuss] gpfsug-discuss Digest, Vol 108, Issue 18<br>Message-ID:<br>                 &lt;OF422FFF6C.8A781185-ONC125866B.006AA4E2-C125866B.006D5F39@notes.na.collabserv.com&gt;<br>                 <br>Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;<br><br>sounds quite complicated. <br>if all public holidays can be ignored it is simple: <br>the algorithm has only to run on week days (the effective age of files <br>would not change on weekend days.). <br>To find the latest date to remove files:<br><br>Now, enumerate the weekdays, starting with Mon=1<br><br>If your max age is T<br>find the integer multiple of 5 and the remainder such that T=T_i*5 +R<br><br>Determine the current DoW in terms of your enumeration. <br><br>if DoW - R &gt; 0, your max age date is Dx=D-(R+7*T_i)<br>else your max age date is Dx=D-(R+2+7*T_i<br><br>dates can be easily compiled in epoch, like D_e=$(date +%s), Dx_e = D_e - <br>86400*(R+7*T_i) or Dx_e = D_e - 86400*(R+2+7*T_i)<br>you then need to convert the found epoch time back into a christian date <br>which could be done by date --date='@&lt;epoch_time'<br><br>example: <br>T=16<br>today is Thu, Jan 28. <br>T_i=3<br>R=1<br>DoW=4<br><br>D_e=1611863080 &nbsp;## y.m.m.v<br>Dx_e=1611863080-86400*(2+7*3)=1609875880<br><br>$ date --date='@1609875880'<br>Tue &nbsp;5 Jan 20:44:40 CET 2021<br><br>Just made that up, but it should do the trick<br><br><br>Mit freundlichen Gr??en / Kind regards<br><br>Dr. Uwe Falke<br>IT Specialist<br>Hybrid Cloud Infrastructure / Technology Consulting &amp; Implementation <br>Services<br>+49 175 575 2877 Mobile<br>Rochlitzer Str. 19, 09111 Chemnitz, Germany<br>uwefalke@de.ibm.com<br><br>IBM Services<br><br>IBM Data Privacy Statement<br><br>IBM Deutschland Business &amp; Technology Services GmbH<br>Gesch?ftsf?hrung: Sven Schooss, Stefan Hierl<br>Sitz der Gesellschaft: Ehningen<br>Registergericht: Amtsgericht Stuttgart, HRB 17122<br><br><br><br>From: &nbsp; &quot;Madhav Ponamgi1&quot; &lt;mzp@us.ibm.com&gt;<br>To: &nbsp; &nbsp; gpfsug-discuss@spectrumscale.org<br>Date: &nbsp; 28/01/2021 19:43<br>Subject: &nbsp; &nbsp; &nbsp; &nbsp;[EXTERNAL] Re: [gpfsug-discuss] gpfsug-discuss Digest, Vol <br>108, Issue 18<br>Sent by: &nbsp; &nbsp; &nbsp; &nbsp;gpfsug-discuss-bounces@spectrumscale.org<br><br><br><br>To calculate this directly (if you don't want to depend on a utility) <br>consider the following steps. There<br>are many more such algorithms in the wonderful book Calenderical <br>Calculations.<br><br>1. &nbsp; &nbsp; &nbsp;Take the last two digits of the year. <br>2. &nbsp; &nbsp; &nbsp;Divide by 4, discarding any fraction. <br>3. &nbsp; &nbsp; &nbsp;Add the day of the month. <br>4. &nbsp; &nbsp; &nbsp;Add the month's key value: JFM AMJ JAS OND 144 025 036 146 <br>5. &nbsp; &nbsp; &nbsp;Subtract 1 for January or February of a leap year. <br>6. &nbsp; &nbsp; &nbsp;For a Gregorian date, add 0 for 1900's, 6 for 2000's, 4 for <br>1700's, 2 for 1800's; for other years, add or subtract multiples of 400. <br>7. &nbsp; &nbsp; &nbsp;For a Julian date, add 1 for 1700's, and 1 for every additional <br>century you go back. <br>8. &nbsp; &nbsp; &nbsp;Add the last two digits of the year. <br>9. &nbsp; &nbsp; &nbsp;Divide by 7 and take the remainder. <br>---<br>Madhav<br>mzp@us.ibm.com<br><br><br>gpfsug-discuss-request---01/28/2021 01:32:13 PM---Send gpfsug-discuss <br>mailing list submissions to gpfsug-discuss@spectrumscale.org<br><br>From: gpfsug-discuss-request@spectrumscale.org<br>To: gpfsug-discuss@spectrumscale.org<br>Date: 01/28/2021 01:32 PM<br>Subject: [EXTERNAL] gpfsug-discuss Digest, Vol 108, Issue 18<br>Sent by: gpfsug-discuss-bounces@spectrumscale.org<br><br><br><br>Send gpfsug-discuss mailing list submissions to<br>gpfsug-discuss@spectrumscale.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br></font></tt><tt><font size="2"><a href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss">http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a></font></tt><tt><font size="2">&nbsp; <br>or, via email, send a message with subject or body 'help' to<br>gpfsug-discuss-request@spectrumscale.org<br><br>You can reach the person managing the list at<br>gpfsug-discuss-owner@spectrumscale.org<br><br>When replying, please edit your Subject line so it is more specific<br>than &quot;Re: Contents of gpfsug-discuss digest...&quot;<br><br><br>Today's Topics:<br><br> &nbsp;1. Re: Policy Rules Syntax to find files older than X days<br> &nbsp; &nbsp; excluding weekends in the calculation.... (Owen Morgan)<br> &nbsp;2. Number of vCPUs exceeded (Mervini, Joseph A)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Thu, 28 Jan 2021 14:27:35 +0000<br>From: Owen Morgan &lt;owen.morgan@motionpicturesolutions.com&gt;<br>To: &quot;mark.bergman@uphs.upenn.edu&quot; &lt;mark.bergman@uphs.upenn.edu&gt;,<br>&quot;gpfsug-discuss@spectrumscale.org&quot; &lt;gpfsug-discuss@spectrumscale.org&gt;<br>Subject: Re: [gpfsug-discuss] Policy Rules Syntax to find files older<br>than X days excluding weekends in the calculation....<br>Message-ID:<br>&lt;VI1PR09MB399809E3E571E7471276FD0B88BA9@VI1PR09MB3998.eurprd09.prod.outlook.com&gt;<br><br>Content-Type: text/plain; charset=&quot;utf-8&quot;<br><br>Mark,<br><br>Thank you for taking the time to comment, I genuinely appreciate it!<br><br>I will digest and look at the mmfind examples (to be honest, didn't know <br>it was a thing.....).<br><br>Everything I know about Spectrum Scale (and Spectrum Archive) has been <br>self taught so...... I'm pretty sure I'm missing Soooooooooo much useful <br>info!<br><br>I wish there was like a dummies guide (I've read the redbooks and admin <br>guides as best I can but I know my knowledge is patchy at best)!<br><br>Once digested I may, or may not, have further questions but I genuinely <br>thank you for your assistance.<br><br>Owen.<br>[Sent from Front]<br><br>Owen Morgan<br>Data Wrangler<br>Motion Picture Solutions Ltd<br>T: <br>E: owen.morgan@motionpicturesolutions.com | W: motionpicturesolutions.com<br>A: Mission Hall, 9-11 North End Road, London, W14 8ST<br>Motion Picture Solutions Ltd is a company registered in England and Wales <br>under number 5388229, VAT number 201330482<br>On Wed, Jan 27 at 11:53 pm, &lt;mark.bergman@uphs.upenn.edu&lt;<br></font></tt><tt><font size="2"><a href="mailto:mark.bergman@uphs.upenn.edu">mailto:mark.bergman@uphs.upenn.edu</a></font></tt><tt><font size="2">&gt;&gt; mark.bergman@uphs.upenn.edu&lt;<br></font></tt><tt><font size="2"><a href="mailto:mark.bergman@uphs.upenn.edu">mailto:mark.bergman@uphs.upenn.edu</a></font></tt><tt><font size="2">&gt; wrote:<br><br>In the message dated: Wed, 27 Jan 2021 22:17:09 +0000,<br>The pithy ruminations from Owen Morgan on<br>[[External] [gpfsug-discuss] Policy Rules Syntax to find files older than <br>X days excluding weekends in the calculation....] were:<br>=&gt; Hi Everyone,<br>=&gt;<br>=&gt; First question from me I appreciate this is policy engine thing as<br>=&gt; opposed to more fundamental Spectrum Scale so hope its ok!<br><br>It's great.<br><br>=&gt;<br>=&gt; I'm trying to find a 'neat' way within a couple of policy rules to<br>=&gt; measure different time intervals (in days) but solely interested in <br>WEEK<br>=&gt; DAYS only (ie delete files older than X week days only).<br><br><br>Policy SQL syntax gives me a headache. For this kind of task, I find<br>that mmfind is your friend -- it's in the &quot;examples&quot; source dir within<br>/usr/lpp/mmfs. Trivial to compile &amp; install. Easier to debug, and it<br>will generate the SQL.<br><br>=&gt;<br>=&gt; An example is one of the rules a team would like implemented is delete<br>=&gt; all files older than 10 business days (ie week days only. We are<br><br>What about &quot;delete all files older than 12 calendar days&quot; -- by<br>definition, those files are older than 10 business days as well.<br><br>=&gt; ignoring public holidays as if they don't exist). Followed by a <br>separate<br>=&gt; rule for a different folder of deleting all files older than 4 business<br>=&gt; days.<br><br>Or, older than 6 calendar days.<br><br>Or, run this nightly:<br><br>#! /bin/bash<br>dateOffset=0<br>if [ `date '+%u'` -le 4 ] ; then<br># Mon=1, Tue=2, Wed=3, Thu=4<br>#<br># For a file to be more than 4 business days old on-or-before the<br># 4th day of the week, it must span the weekend, so offset the number<br># of required days in the file age<br>dateOffset=2<br>fi<br><br>mmfind -mtime $((4 + $dateOffset)) /path/to/Nuke/After/4/Days -xarg rm -f<br><br><br>=&gt;<br>=&gt; Thanks in advance,<br>=&gt;<br>=&gt; Owen. [Sent from Front]<br>=&gt;<br>=&gt; Owen Morgan Data Wrangler Motion Picture Solutions Ltd T: E:<br>=&gt; owen.morgan@motionpicturesolutions.com&lt;<br></font></tt><tt><font size="2"><a href="mailto:owen.morgan@motionpicturesolutions.com">mailto:owen.morgan@motionpicturesolutions.com</a></font></tt><tt><font size="2">&gt; | W: <br>motionpicturesolutions.com&lt;</font></tt><tt><font size="2"><a href="http://motionpicturesolutions.com">http://motionpicturesolutions.com</a></font></tt><tt><font size="2">&nbsp; &gt;<br>=&gt; A: Mission Hall, 9-11 North End Road, London, W14 8ST Motion Picture<br>=&gt; Solutions Ltd is a company registered in England and Wales under number<br>=&gt; 5388229, VAT number 201330482<br>=&gt;<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: &lt;<br></font></tt><tt><font size="2"><a href="http://gpfsug.org/pipermail/gpfsug-discuss/attachments/20210128/201a280e/attachment-0001.html">http://gpfsug.org/pipermail/gpfsug-discuss/attachments/20210128/201a280e/attachment-0001.html</a></font></tt><tt><font size="2">&nbsp; <br>&gt;<br><br>------------------------------<br><br>Message: 2<br>Date: Thu, 28 Jan 2021 18:26:37 +0000<br>From: &quot;Mervini, Joseph A&quot; &lt;jamervi@sandia.gov&gt;<br>To: &quot;gpfsug-discuss@spectrumscale.org&quot;<br>&lt;gpfsug-discuss@spectrumscale.org&gt;<br>Subject: [gpfsug-discuss] Number of vCPUs exceeded<br>Message-ID: &lt;59193954-B649-4DF5-AD21-652922E49FD9@contoso.com&gt;<br>Content-Type: text/plain; charset=&quot;utf-8&quot;<br><br>Hi,<br><br>I haven?t seen this before but one of my remote cluster users reported the <br>system in question is experiencing high loads and is with Scale unmounting <br>the file system.<br><br>This is the output she is seeing:<br><br>Wed Jan 27 22:18:34.168 2021: [I] GPFS vCPU limits: Low warning limit 3 <br>vCPUs, High warning limit 256 vCPUs, Hard limit 1536 vCPUs.<br>Wed Jan 27 22:18:34.169 2021: [I] GPFS vCPU limits include all vCPUs that <br>Linux sees as online or possibly online via hot add, ht/smt changes, etc.<br>Wed Jan 27 22:18:34.170 2021: [X] GPFS detected 1792 vCPUs. This exceeds <br>the warning limit of 256 vCPUs and the hard limit of 1536 vCPUs. GPFS will <br>shutdown<br><br>Any help will be appreciated.<br><br>Thanks,<br>Joe<br><br>====<br><br>Joe Mervini<br>Sandia National Laboratories<br>High Performance Computing<br>505.844.6770<br>jamervi@sandia.gov&lt;</font></tt><tt><font size="2"><a href="mailto:jamervi@sandia.gov">mailto:jamervi@sandia.gov</a></font></tt><tt><font size="2">&gt;<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: &lt;<br></font></tt><tt><font size="2"><a href="http://gpfsug.org/pipermail/gpfsug-discuss/attachments/20210128/930fadb1/attachment.html">http://gpfsug.org/pipermail/gpfsug-discuss/attachments/20210128/930fadb1/attachment.html</a></font></tt><tt><font size="2">&nbsp; <br>&gt;<br><br>------------------------------<br><br>_______________________________________________<br>gpfsug-discuss mailing list<br>gpfsug-discuss at spectrumscale.org<br></font></tt><tt><font size="2"><a href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss">http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a></font></tt><tt><font size="2">&nbsp; <br><br><br>End of gpfsug-discuss Digest, Vol 108, Issue 18<br>***********************************************<br><br><br><br>_______________________________________________<br>gpfsug-discuss mailing list<br>gpfsug-discuss at spectrumscale.org<br></font></tt><tt><font size="2"><a href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss">http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a></font></tt><tt><font size="2">&nbsp; <br><br><br><br><br><br><br><br>------------------------------<br><br>_______________________________________________<br>gpfsug-discuss mailing list<br>gpfsug-discuss at spectrumscale.org<br></font></tt><tt><font size="2"><a href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss">http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a></font></tt><tt><font size="2">&nbsp;<br><br><br>End of gpfsug-discuss Digest, Vol 108, Issue 20<br>***********************************************<br><br></font></tt><br><br><BR>
</body></html>