diff --git a/scripts/gpuq_worker.sh b/scripts/gpuq_worker.sh index 827ee5b..5beba0a 100755 --- a/scripts/gpuq_worker.sh +++ b/scripts/gpuq_worker.sh @@ -32,8 +32,8 @@ while true; do fi name=$(basename "$job" .sh) echo "[gpuq $ID] $(date +%F_%H:%M:%S) START $name" - CUDA_VISIBLE_DEVICES=$GPU bash "$job" > "$LOCAL/$name.log" 2>&1 - rc=$? + CUDA_VISIBLE_DEVICES=$GPU bash "$job" 2>&1 | tee "$LOCAL/$name.log" + rc=${PIPESTATUS[0]} echo "[gpuq $ID] $(date +%F_%H:%M:%S) DONE $name rc=$rc" echo "rc=$rc" >> "$LOCAL/$name.log" rclone copy "$LOCAL/$name.log" "$Q/done/" -q