Skip to content
Snippets Groups Projects

BUGFIX: Change ownership to executing USER and group to atlab. Also automatically gzip the log output

1 file
+ 8
6
Compare changes
  • Side-by-side
  • Inline
@@ -102,7 +102,7 @@ tmpscratch="${outdir}/slurm-tmp-${SLURM_JOBID}"
nodes=$(scontrol show hostnames "${SLURM_JOB_NODELIST}" | tr '\n' ',' | sed -e 's/,$//')
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})
filetag="${policy}_slurm-${SLURM_JOBID}_${DATESTR}"
@@ -124,17 +124,19 @@ if [[ ! ${dry_run} ]]; then
${cmd}
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}
# tag output file with run metadata
raw_log_file=$(find ${outdir} -maxdepth 1 -name "list-${SLURM_JOBID}*" -type f | head -1)
if [[ "$raw_log_file" != "" ]]; then
mv -n ${raw_log_file} ${log_dir}/${log_name}
chmod 440 ${log_dir}/${log_name}
gzip ${log_dir}/${log_name}
mv -n ${raw_log_file} ${log_dir}/raw/${log_name}
gzip ${log_dir}/raw/${log_name}
chmod 440 ${log_dir}/raw/${log_name}.gz
chmod 550 ${log_dir}/raw
fi
chown -R ${USER}:atlab ${log_dir}
Loading