Jonathan,

If I have a single policy file with all the related department rules and each 
time they want to add additional rules with different working day thresholds 
maybe using this -M method is easier. Its clear that the 'maths' and 
date/timestamp manipulation is easier in shell (my preferred is bash) than in 
the SQL of the policy (your example is succinct but needs to be repeated 
everytime a new rule is added with a different working day threshold, which is 
what I'm trying (if possiblr) to avoid.

It seems to me the IBM SQL engine is perhaps missing more 'SQL' in built 
date/time functions like DateAdd and DateDiff etc..  as this would be a moot 
point. Its a shame I can't make one function that given a working day input as 
an argument spits out how many 'real' days exist between them for the file age 
comparison all in the SQL. It can be done for 1 specific input argument, but 
needs the whole function repeated manually for a different input argument, and 
further repeated for a different argument etc..

Maybe I'm also compounding the issue by trying to make the policy file as 
concise as possible (for sake of clarity as to what the rules are trying to 
achieve, and easy expandability), and demanding too much of the SQL-like syntax 
that IBM have created.

I have options for mmfind or even (as suggested) -M inoput to mmapplypolicy 
where I us bash to create a small function that does what I need, spits out 
'real days' given a working day input, and using arrays and for-loop create a 
dynamic calling of the mmapplypolicy command (which I'm kinda half doing 
anyways for other reasons in my launcher script.


As always, I'm seriously amazed at people with soo much experience and 
knowledge taking time out to help, guide, and offer input like everyone has 
been doing!! I'm relatively early in my career, so being able to interact and 
learn from experienced persons is giving me such a wider insight!

Thanks!

Owen.
[Sent from Front]
On 1 February 2021, 20:17 GMT 
[email protected]<mailto:[email protected]> wrote:

On 01/02/2021 18:11, Jan-Frode Myklebust wrote:

> CAUTION: This email originated outside the University. Check before
> clicking links or attachments.
> 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
>

Why bother when you can do it all in the policy?

JAB.

--
Jonathan A. Buzzard Tel: +44141-5483420
HPC System Administrator, ARCHIE-WeSt.
University of Strathclyde, John Anderson Building, Glasgow. G4 0NG


Owen Morgan
Data Wrangler
Motion Picture Solutions Ltd
T: 
E: [email protected] | 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
_______________________________________________
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss

Reply via email to