Agree.. Write a policy that takes a "mmapplypolicy -M var=val" argument, and figure out the workdays outside of the policy. Something like: # cat test.poilcy define( access_age, (DAYS(CURRENT_TIMESTAMP) - DAYS(ACCESS_TIME))) /* list migrated files */ RULE EXTERNAL LIST 'oldFiles' EXEC '' RULE 'oldFiles' LIST 'oldFiles' WHERE (access_age > MINAGE) # mmapplypolicy gpfs01 -P test.policy -I defer -f ./filelist -M MINAGE=5 On Mon, Feb 1, 2021 at 5:29 PM Daniel Kidger <daniel.kidger@uk.ibm.com> wrote:
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.* IBM Technical Sales Specialist Spectrum Scale, Spectrum Discover and IBM Cloud Object Storage
+44-(0)7818 522 266 daniel.kidger@uk.ibm.com
<https://www.youracclaim.com/badges/687cf790-fe65-4a92-b129-d23ae41862ac/publ...> <https://www.youracclaim.com/badges/8dac4bc0-7b3a-4035-b127-daec8dce9200> <https://www.youracclaim.com/badges/8153c6a7-3e02-40be-87ee-24e27ae9459c/publ...> <https://www.youracclaim.com/badges/78197e2c-4277-4ec9-808b-ad6abe1e1b16/publ...>
----- Original message ----- From: Jonathan Buzzard <jonathan.buzzard@strath.ac.uk> Sent by: gpfsug-discuss-bounces@spectrumscale.org To: gpfsug-discuss@spectrumscale.org 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
Unless stated otherwise above: 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
