<html><body><p><font size="2">To calculate this directly (if you don't want to depend on a utility) consider the following steps.   There</font><br><font size="2">are many more such algorithms in the wonderful book Calenderical Calculations.</font><br><br>
<ul><ol type="1"><li>Take the last two digits of the year. 
<li>Divide by 4, discarding any fraction. 
<li>Add the day of the month. 
<li>Add the month's key value: JFM AMJ JAS OND 144 025 036 146 
<li>Subtract 1 for January or February of a leap year. 
<li>For a Gregorian date, add 0 for 1900's, 6 for 2000's, 4 for 1700's, 2 for 1800's; for other years, add or subtract multiples of 400. 
<li>For a Julian date, add 1 for 1700's, and 1 for every additional century you go back. 
<li>Add the last two digits of the year. 
<li>Divide by 7 and take the remainder. </ol></ul><font size="2">---</font><br><font size="2">Madhav</font><br><font size="2">mzp@us.ibm.com</font><br><br><br><img width="16" height="16" src="cid:1__=8FBB0CF8DFF5D32C8f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for gpfsug-discuss-request---01/28/2021 01:32:13 PM---Send gpfsug-discuss mailing list submissions to  gp"><font size="2" color="#424282">gpfsug-discuss-request---01/28/2021 01:32:13 PM---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/28/2021 01:32 PM</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">[EXTERNAL] gpfsug-discuss Digest, Vol 108, Issue 18</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"> <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 "Re: Contents of gpfsug-discuss digest..."<br><br><br>Today's Topics:<br><br>   1. Re: Policy Rules Syntax to find files older than X days<br>      excluding weekends in the calculation.... (Owen Morgan)<br>   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 <owen.morgan@motionpicturesolutions.com><br>To: "mark.bergman@uphs.upenn.edu" <mark.bergman@uphs.upenn.edu>,<br>                 "gpfsug-discuss@spectrumscale.org" <gpfsug-discuss@spectrumscale.org><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>                 <VI1PR09MB399809E3E571E7471276FD0B88BA9@VI1PR09MB3998.eurprd09.prod.outlook.com><br>                 <br>Content-Type: text/plain; charset="utf-8"<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 it was a thing.....).<br><br>Everything I know about Spectrum Scale (and Spectrum Archive) has been self taught so...... I'm pretty sure I'm missing Soooooooooo much useful info!<br><br>I wish there was like a dummies guide (I've read the redbooks and admin 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 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 under number 5388229, VAT number 201330482<br>On Wed, Jan 27 at 11:53 pm, <mark.bergman@uphs.upenn.edu<</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">>> mark.bergman@uphs.upenn.edu<</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">> 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 X days excluding weekends in the calculation....] were:<br>=> Hi Everyone,<br>=><br>=> First question from me I appreciate this is policy engine thing as<br>=> opposed to more fundamental Spectrum Scale so hope its ok!<br><br>It's great.<br><br>=><br>=> I'm trying to find a 'neat' way within a couple of policy rules to<br>=> measure different time intervals (in days) but solely interested in WEEK<br>=> 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 "examples" source dir within<br>/usr/lpp/mmfs. Trivial to compile & install. Easier to debug, and it<br>will generate the SQL.<br><br>=><br>=> An example is one of the rules a team would like implemented is delete<br>=> all files older than 10 business days (ie week days only. We are<br><br>What about "delete all files older than 12 calendar days" -- by<br>definition, those files are older than 10 business days as well.<br><br>=> ignoring public holidays as if they don't exist). Followed by a separate<br>=> rule for a different folder of deleting all files older than 4 business<br>=> 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>=><br>=> Thanks in advance,<br>=><br>=> Owen. [Sent from Front]<br>=><br>=> Owen Morgan Data Wrangler Motion Picture Solutions Ltd T: E:<br>=> owen.morgan@motionpicturesolutions.com<</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">> | W: motionpicturesolutions.com<</font></tt><tt><font size="2"><a href="http://motionpicturesolutions.com">http://motionpicturesolutions.com</a></font></tt><tt><font size="2"> ><br>=> A: Mission Hall, 9-11 North End Road, London, W14 8ST Motion Picture<br>=> Solutions Ltd is a company registered in England and Wales under number<br>=> 5388229, VAT number 201330482<br>=><br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <</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"> ><br><br>------------------------------<br><br>Message: 2<br>Date: Thu, 28 Jan 2021 18:26:37 +0000<br>From: "Mervini, Joseph A" <jamervi@sandia.gov><br>To: "gpfsug-discuss@spectrumscale.org"<br>                 <gpfsug-discuss@spectrumscale.org><br>Subject: [gpfsug-discuss] Number of vCPUs exceeded<br>Message-ID: <59193954-B649-4DF5-AD21-652922E49FD9@contoso.com><br>Content-Type: text/plain; charset="utf-8"<br><br>Hi,<br><br>I haven?t seen this before but one of my remote cluster users reported  the system in question is experiencing high loads and is with Scale unmounting 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 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 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 the warning limit of 256 vCPUs and the hard limit of 1536 vCPUs. GPFS will 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<</font></tt><tt><font size="2"><a href="mailto:jamervi@sandia.gov">mailto:jamervi@sandia.gov</a></font></tt><tt><font size="2">><br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <</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"> ><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"> <br><br><br>End of gpfsug-discuss Digest, Vol 108, Issue 18<br>***********************************************<br><br></font></tt><br><br><BR>
</body></html>