From 9e5334d83599cdef09f180c3f0411d6cf9b97e7e Mon Sep 17 00:00:00 2001 From: Matthijs van der Wild Date: Mon, 28 Oct 2024 16:13:40 +0000 Subject: Add option to specify a separate output directory --- pilot.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'pilot.sh') diff --git a/pilot.sh b/pilot.sh index b41f6fd..d497415 100644 --- a/pilot.sh +++ b/pilot.sh @@ -18,7 +18,7 @@ set_container() { fi } -opts=$(getopt -o rhf:c:p: --long restart,help,container:,scratch: \ +opts=$(getopt -o rhf:c:p: --long restart,help,container:,scratch:,outdir: \ -n 'pilot' -- "$@") eval set -- "$opts" @@ -33,6 +33,7 @@ while true; do -p ) PIPELINE="${2}"; shift 2 ;; -r | --restart) RESTART="--restart"; shift ;; --scratch) SCRATCH="${2}"; shift 2 ;; + --outdir) OUTDIR="${2}"; shift 2;; * ) shift; break ;; esac done @@ -52,14 +53,14 @@ INPUT_DIR="${2}" PIPELINE_LOG="${HOME}/${WORKFLOW_NAME}.log" -TMP_OUTDIR="${INPUT_DIR}/toil/tmp/tmp/" -JOB_LOG_DIR="${INPUT_DIR}/toil/logs/" -BATCH_LOG_DIR="${TOIL_BATCH_LOGS_DIR:-${INPUT_DIR}/toil/logs}" -WORK_DIR="${INPUT_DIR}/toil/work/" -# TODO: optionally decouple output directory from input directory? -OUTPUT_DIR="${INPUT_DIR}/${WORKFLOW_NAME}_results" -JOBSTORE_DIR="${INPUT_DIR}/toil/${WORKFLOW_NAME}_job/" -STATS_DIR="${OUTPUT_DIR}/stats" +TMP_OUTDIR="${OUTDIR-$INPUT_DIR}/toil/tmp/tmp/" +JOB_LOG_DIR="${OUTDIR-$INPUT_DIR}/toil/logs/" +BATCH_LOG_DIR="${OUTDIR-$TOIL_BATCH_LOGS_DIR:-${INPUT_DIR}/toil/logs}" +WORK_DIR="${OUTDIR-$INPUT_DIR}/toil/work/" + +OUTPUT_DIR="${OUTDIR-$INPUT_DIR}/${WORKFLOW_NAME}_results" +JOBSTORE_DIR="${OUTDIR-$INPUT_DIR}/toil/${WORKFLOW_NAME}_job/" +STATS_DIR="${OUTDIR-$OUTPUT_DIR}/stats" mkdir -p "$JOB_LOG_DIR" mkdir -p "$BATCH_LOG_DIR" -- cgit v1.2.3