To me, it feels like you need to do the search the other way around.
Firstly, from the target of say "4 weekdays ago", work out how many real days ago that was.
Then use that as a criteria in mmfind or mmapplypolicy.
Daniel
_________________________________________________________
Daniel Kidger Ph.D.
Daniel Kidger Ph.D.
IBM Technical Sales Specialist
----- Original message -----
From: Jonathan Buzzard <[email protected]>
Sent by: [email protected]
To: [email protected]
Cc:
Subject: [EXTERNAL] Re: [gpfsug-discuss] gpfsug-discuss Digest, Vol 108, Issue 18
Date: Sat, Jan 30, 2021 10:29
On 30/01/2021 00:31, Owen Morgan wrote:
[SNIP]
>
> I would prefer to stay in the bounds of the SQL policy rule setup as
> that is the framework I have created and started to implement..
>
In general SQL is Turing complete. Though I have not checked in detail I
believe the SQL of the policy engine is too.
I would also note that SQL has a whole bunch of time/date functions.
So something like
define(offset, 4)
define(day, DAYOFWEEK(CURRENT_TIMESTAMP))
define(age,(DAYS(CURRENT_TIMESTAMP)-DAYS(ACCESS_TIME)))
define(workingdays,
CASE
WHEN day=1
THEN offest+1
WHEN day=6
THEN offset
WHEN day=7
THEN offset+1
ELSE
offset+2
)
/* delete all files from files older than 4 working days */
RULE purge4 DELETE
WHERE (age>workingdays) FOR FILESET dummies
JAB.
--
Jonathan A. Buzzard Tel: +44141-5483420
HPC System Administrator, ARCHIE-WeSt.
University of Strathclyde, John Anderson Building, Glasgow. G4 0NG
_______________________________________________
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
_______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
