#!/bin/bash # Run one audit script on M3U96b in the background under nice, with a log and a done-marker. # usage: run_one.sh [args...] (from ~/firc0001_review) set -u cd "$HOME/firc0001_review" S="$1"; shift NAME=$(basename "$S" | sed -E 's/\.(py|sh)$//') LOG="logs/$NAME.log"; DONE="logs/$NAME.done" rm -f "$DONE" PY="$HOME/UQO_RESEARCH_DB/.venv/bin/python" if [[ "$S" == *.sh ]]; then CMD="bash scripts/$S $*"; else CMD="$PY -I scripts/$S $*"; fi nohup bash -c "echo START \$(date -Iseconds); nice -n 10 env OMP_NUM_THREADS=4 FIRC_THREADS=4 $CMD; echo RC=\$? END \$(date -Iseconds) > $DONE" > "$LOG" 2>&1 & echo "started $NAME pid=$! log=$LOG"