| #!/usr/bin/env bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| set -uo pipefail |
|
|
| HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| BASE="$(dirname "$HERE")" |
| LOGDIR="$BASE/logs"; mkdir -p "$LOGDIR" |
|
|
| CAPTURES=("$@") |
| if [ ${#CAPTURES[@]} -eq 0 ]; then |
| CAPTURES=(P2C1 P2C2 P3C2 P4C1 P4C2 P5C2) |
| fi |
|
|
| STAMP="$(date +%Y%m%d_%H%M%S)" |
| SUMMARY="$LOGDIR/seq_summary_${STAMP}.txt" |
| echo "sequential upload of ${#CAPTURES[@]} captures: ${CAPTURES[*]}" | tee "$SUMMARY" |
| echo "started $(date)" | tee -a "$SUMMARY" |
|
|
| for c in "${CAPTURES[@]}"; do |
| log="$LOGDIR/seq_${c}_${STAMP}.log" |
| echo "" | tee -a "$SUMMARY" |
| echo "########## $c start $(date +%H:%M:%S) -> $log" | tee -a "$SUMMARY" |
| t0=$(date +%s) |
| "$HERE/upload_capture.sh" "$c" > "$log" 2>&1 |
| rc=$? |
| t1=$(date +%s) |
| echo "########## $c exit=$rc elapsed=$(( (t1-t0)/60 ))m$(( (t1-t0)%60 ))s" | tee -a "$SUMMARY" |
| if [ $rc -ne 0 ]; then |
| echo " LAST 15 LINES OF $log:" | tee -a "$SUMMARY" |
| tail -15 "$log" | sed 's/^/ /' | tee -a "$SUMMARY" |
| fi |
| done |
|
|
| echo "" | tee -a "$SUMMARY" |
| echo "finished $(date)" | tee -a "$SUMMARY" |
| echo "ALL DONE" | tee -a "$SUMMARY" |
|
|