Skip to content
Snippets Groups Projects
Commit 7c868e2d authored by Matthew K Defenderfer's avatar Matthew K Defenderfer
Browse files

set up raw directory for policy log to be stored in. change some ordering on permission changes

parent 0237ad44
No related branches found
No related tags found
5 merge requests!24Release v0.2.0,!22Update main to rel_v0.1.1-1,!21Fix some merge errors,!20Refactoring run-mmpol scripts,!19BUGFIX: Change ownership to executing USER and group to atlab. Also automatically gzip the log output
...@@ -102,7 +102,7 @@ tmpscratch="${outdir}/slurm-tmp-${SLURM_JOBID}" ...@@ -102,7 +102,7 @@ tmpscratch="${outdir}/slurm-tmp-${SLURM_JOBID}"
nodes=$(scontrol show hostnames "${SLURM_JOB_NODELIST}" | tr '\n' ',' | sed -e 's/,$//') nodes=$(scontrol show hostnames "${SLURM_JOB_NODELIST}" | tr '\n' ',' | sed -e 's/,$//')
cores="${SLURM_CPUS_PER_TASK}" cores="${SLURM_CPUS_PER_TASK}"
DATESTR=$(date +'%Y%m%dT%H%M%S') DATESTR=$(date +'%Y-%m-%dT%H:%M:%S')
policy=$(basename ${policy_file}) policy=$(basename ${policy_file})
filetag="${policy}_slurm-${SLURM_JOBID}_${DATESTR}" filetag="${policy}_slurm-${SLURM_JOBID}_${DATESTR}"
...@@ -124,17 +124,19 @@ if [[ ! ${dry_run} ]]; then ...@@ -124,17 +124,19 @@ if [[ ! ${dry_run} ]]; then
${cmd} ${cmd}
log_name="${output_log_prefix}_${filetag}" log_name="${output_log_prefix}_${filetag}"
log_dir="${outdir}/${log_name}.d" log_dir="${outdir}/${log_name}"
mkdir ${log_dir} mkdir -p ${log_dir}/raw
chmod 1770 ${log_dir} chmod 1770 ${log_dir}
# tag output file with run metadata # tag output file with run metadata
raw_log_file=$(find ${outdir} -maxdepth 1 -name "list-${SLURM_JOBID}*" -type f | head -1) raw_log_file=$(find ${outdir} -maxdepth 1 -name "list-${SLURM_JOBID}*" -type f | head -1)
if [[ "$raw_log_file" != "" ]]; then if [[ "$raw_log_file" != "" ]]; then
mv -n ${raw_log_file} ${log_dir}/${log_name} mv -n ${raw_log_file} ${log_dir}/raw/${log_name}
chmod 440 ${log_dir}/${log_name} gzip ${log_dir}/raw/${log_name}
gzip ${log_dir}/${log_name}
chmod 440 ${log_dir}/raw/${log_name}.gz
chmod 550 ${log_dir}/raw
fi fi
chown -R ${USER}:atlab ${log_dir} chown -R ${USER}:atlab ${log_dir}
......
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