Skip to content

Instantly share code, notes, and snippets.

@sminot
Created January 14, 2022 18:26
Show Gist options
  • Save sminot/56b0b310fc034f8bf5304785f4308f3f to your computer and use it in GitHub Desktop.
Save sminot/56b0b310fc034f8bf5304785f4308f3f to your computer and use it in GitHub Desktop.
Print the log file from a Nextflow task using its short hash
#!/bin/bash
set -euo pipefail
WORK_DIR="${1}"
# Input is the short task id prefix
TASK_PREFIX="${2}"
# Get the complete suffix
TASK_SUFFIX="$( aws s3 ls ${WORK_DIR}/${TASK_PREFIX} | sed 's/.* //' )"
# Assemble the complete task path
TASK_DIR="${WORK_DIR}/${TASK_PREFIX:0:2}/${TASK_SUFFIX}"
# Get the logs
aws s3 cp "${TASK_DIR}.command.log" -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment