Commit e4f96420 authored by Blaise Li's avatar Blaise Li
Browse files

Wrapper gives hint to find old pipeline outputs.

parent f4d1874a
......@@ -72,12 +72,17 @@ else
error_exit "Pipeline configuration file ${configfile} not found."
fi
# Determine the output directory and where to log the pipeline
# Determine the output directory and where to log the pipeline (fragile!)
output_dir=$(grep "output_dir" "${configfile}" | mawk '{print $NF}' | sed 's/,$//' | sed 's/"//g')
mkdir -p ${output_dir}
start_day=$(date +"%Y-%m-%d")
find_older_output="find ${output_dir} -depth ! -newermt ${start_day} -print"
log_base="${output_dir}/$(date +"%d%m%y_%Hh%Mm")"
mkdir -p ${output_dir}
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, see ${log_base}.err"
echo -e "This run started on ${start_day}.\nIf you want to find all older output, you can run the following command:\n${find_older_output}\n(Use -delete instead of -print to remove those files (do this only in case of full output update).)"
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