[gpfsug-discuss] gpfsug-discuss Digest, Vol 108, Issue 18

Jonathan Buzzard jonathan.buzzard at strath.ac.uk
Sat Jan 30 10:29:39 GMT 2021


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



More information about the gpfsug-discuss mailing list