[gpfsug-discuss] Policy Rules Syntax to find files older than X days excluding weekends in the calculation....

Owen Morgan owen.morgan at motionpicturesolutions.com
Thu Jan 28 14:27:35 GMT 2021


Mark,

Thank you for taking the time to comment, I genuinely appreciate it!

I will digest and look at the mmfind examples (to be honest, didn't know it was a thing.....).

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!

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)!

Once digested I may, or may not, have further questions but I genuinely thank you for your assistance.

Owen.
[Sent from Front]

Owen Morgan
Data Wrangler
Motion Picture Solutions Ltd
T: 
E: owen.morgan at motionpicturesolutions.com | W: motionpicturesolutions.com
A: Mission Hall, 9-11 North End Road, London, W14 8ST
Motion Picture Solutions Ltd is a company registered in England and Wales under number 5388229, VAT number 201330482
On Wed, Jan 27 at 11:53 pm, <mark.bergman at uphs.upenn.edu<mailto:mark.bergman at uphs.upenn.edu>> mark.bergman at uphs.upenn.edu<mailto:mark.bergman at uphs.upenn.edu> wrote:

In the message dated: Wed, 27 Jan 2021 22:17:09 +0000,
The pithy ruminations from Owen Morgan on
[[External] [gpfsug-discuss] Policy Rules Syntax to find files older than X days excluding weekends in the calculation....] were:
=> Hi Everyone,
=>
=> First question from me I appreciate this is policy engine thing as
=> opposed to more fundamental Spectrum Scale so hope its ok!

It's great.

=>
=> I'm trying to find a 'neat' way within a couple of policy rules to
=> measure different time intervals (in days) but solely interested in WEEK
=> DAYS only (ie delete files older than X week days only).


Policy SQL syntax gives me a headache. For this kind of task, I find
that mmfind is your friend -- it's in the "examples" source dir within
/usr/lpp/mmfs. Trivial to compile & install. Easier to debug, and it
will generate the SQL.

=>
=> An example is one of the rules a team would like implemented is delete
=> all files older than 10 business days (ie week days only. We are

What about "delete all files older than 12 calendar days" -- by
definition, those files are older than 10 business days as well.

=> ignoring public holidays as if they don't exist). Followed by a separate
=> rule for a different folder of deleting all files older than 4 business
=> days.

Or, older than 6 calendar days.

Or, run this nightly:

#! /bin/bash
dateOffset=0
if [ `date '+%u'` -le 4 ] ; then
# Mon=1, Tue=2, Wed=3, Thu=4
#
# For a file to be more than 4 business days old on-or-before the
# 4th day of the week, it must span the weekend, so offset the number
# of required days in the file age
dateOffset=2
fi

mmfind -mtime $((4 + $dateOffset)) /path/to/Nuke/After/4/Days -xarg rm -f


=>
=> Thanks in advance,
=>
=> Owen. [Sent from Front]
=>
=> Owen Morgan Data Wrangler Motion Picture Solutions Ltd T: E:
=> owen.morgan at motionpicturesolutions.com<mailto:owen.morgan at motionpicturesolutions.com> | W: motionpicturesolutions.com<http://motionpicturesolutions.com>
=> A: Mission Hall, 9-11 North End Road, London, W14 8ST Motion Picture
=> Solutions Ltd is a company registered in England and Wales under number
=> 5388229, VAT number 201330482
=>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gpfsug.org/pipermail/gpfsug-discuss_gpfsug.org/attachments/20210128/201a280e/attachment-0002.htm>


More information about the gpfsug-discuss mailing list