RULE EXTERNAL LIST 'listfiles' EXEC ' /gpfs/bin/policycat RULE 'xl' LIST 'listfiles' DIRECTORIES_PLUS SHOW ( CASE when MISC_ATTRIBUTES LIKE '%D%' then '^_"'||PATH_NAME|| '/"^_' else '^_"'|| SUBSTR(PATH_NAME,1,LENGTH(PATH_NAME)-LENGTH(NAME)-1) || '/"^_' END ) WHERE ( DAYS(CURRENT_TIMESTAMP) - DAYS(MODIFICATION_TIME) < 9999 ) /* EO POLICY */
The external script /gpfs/bin/policycat looks like
#!/usr/bin/ksh case $1 in # We are invoked from the policy LIST) cat "$2" rc=0 ;; TEST) # Respond with success rc=0 ;; *) # Command not supported by this script rc=1 ;; esac exit $rc
So far so. But how do i get the final result ?
A "mmapplypolicy /gpfs/tmp -P ListPolicy" -I yes gives a mixure of info on stdout AND stderr
A "mmapplypolicy /gpfs/tmp -P ListPolicy -I yes -L 0 gives the output from the external script on STDERR!
My understand is that -L 0 is the default anyway for mmapplypolicy - Why the different behavior ?
How can i be sure that i get with the -L 0 only the filelist and no other error messages from mmapplypolicy ?
A "mmapplypolicy /gpfs/tmp -P ListPolicy" -I defer" gives a file list but the external script has not been used thus further processing must be done.
In case that the external script will write the result to an external file - like in the following example:
... LIST) cat "$2" >> /tmp/policy.result rc=0 ...
i will have a /tmp/policy.result on EACH node taking part of the policy run.
Even in case the result will be written to an shared fs i have no guaranty that the writing of each node does not interfere with another.
So the later can be used if only a single node is running the policy.
So my current option for parallel execution are :
* use the "-L 0" with the risk to get additional stuff on STDERR like:
mmapplypolicy /gpfs/tmp -P ListPolicy -I yes -L 0
* use the "-I defer" with the draw back that the result ( Which might be very large) must be processed further since the "external script is not used at all.
mmapplypolicy /gpfs/tmp -P ListPolicy -I defer MyScript /tmp/....mapplypolicy.list
So the question arise:
How does the command looks like to invoke a list policy on more than on node, let each node using also the external script but get the final result only on a single node ?