Skip to content
Snippets Groups Projects
Commit c4ec7ba3 authored by John-Paul Robinson's avatar John-Paul Robinson
Browse files

Fix improper use of external list name as a unique file tag

Update policy rule with a static (still not existing) external
list rule.
Move the file tagging metadata to the policy apply wrapper script.
parent dcf7bf46
No related branches found
No related tags found
1 merge request!1Resolve "LIST parameter is used incorrectly as a file tag"
...@@ -8,8 +8,7 @@ define(access_age, ...@@ -8,8 +8,7 @@ define(access_age,
(DAYS(CURRENT_TIMESTAMP) - DAYS(ACCESS_TIME)) (DAYS(CURRENT_TIMESTAMP) - DAYS(ACCESS_TIME))
) )
/* note: subtitution via -M for file tag */ RULE 'old_files' LIST 'no_extern_list'
RULE 'old_files' LIST 'FILETAG'
SHOW ('|size=' || varchar(FILE_SIZE) || SHOW ('|size=' || varchar(FILE_SIZE) ||
'|kballoc='|| varchar(KB_ALLOCATED) || '|kballoc='|| varchar(KB_ALLOCATED) ||
'|access=' || varchar(ACCESS_TIME) || '|access=' || varchar(ACCESS_TIME) ||
......
...@@ -14,13 +14,13 @@ cores="${SLURM_CPUS_PER_TASK}" ...@@ -14,13 +14,13 @@ cores="${SLURM_CPUS_PER_TASK}"
DATESTR=`date +'%Y-%m-%d-%H:%M:%S'` DATESTR=`date +'%Y-%m-%d-%H:%M:%S'`
filetag=$policyfile_$DATESTR policy=`basename $policyfile`
filetag="${policy}_slurm-${SLURM_JOBID}_${DATESTR}"
cmd="mmapplypolicy scratch -I prepare \ cmd="mmapplypolicy scratch -I prepare \
-P $policyfile \ -P $policyfile \
-g $tmpglobal \ -g $tmpglobal \
-s $tmpscratch \ -s $tmpscratch \
-M "FILETAG=$filetag"
-N ${nodes} -n ${cores}" -N ${nodes} -n ${cores}"
# report final command in job log # report final command in job log
...@@ -28,3 +28,15 @@ echo $cmd ...@@ -28,3 +28,15 @@ echo $cmd
# run policy command # run policy command
$cmd $cmd
rcode=$?
if [ $rcode -ne 0 ]
then
echo error: mmapplypoicy failed: code $rcode
exit $rcode
fi
# tag output file with run metadata
outfile=`ls -t $tmpglobal | head -1`
mv -n $tmpglobal/$outfile $tmpglobal/$outfile_$filetag
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment