Commit 7803b7a5 authored by Blaise Li's avatar Blaise Li
Browse files

Logging pipeline output.

parent 7fc4c737
......@@ -68,7 +68,13 @@ then
else
error_exit "Pipeline configuration file ${configfile} not found."
fi
echo ${cmd}
eval ${cmd} || error_exit "${cmd} failed"
# Determine the output directory and where to log the pipeline
output_dir=$(grep "output_dir" "${configfile}" | mawk '{print $NF}' | sed 's/,$//' | sed 's/"//g')
mkdir -p ${output_dir}
log_base="${output_dir}/$(date +"%d%m%y_%Hh%Mm")"
echo ${cmd} > ${log_base}.log
# https://stackoverflow.com/a/692407/1878788
eval ${cmd} > >(tee -a ${log_base}.log) 2> >(tee -a ${log_base}.err >&2) || error_exit "${cmd} failed"
exit 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment