blob: 4d5669c780b7cee77e69a92fce756ae36985ce02 [file] [log] [blame]
Jim Ostrowskib797d242023-09-17 23:46:13 -07001#!/bin/bash
2
3# Helper script to copy most recent logs off of the pis
4
5set -e
6
7ROBOT_PREFIX="79" # ..71 (Should be one of 79, 89, 99, or 9)
8PI_LIST="2 3" # Should be some set of {1,2,3,4,5,6}
9
10LOG_FILE_PATH=/media/sda1/fbs_log-current
11if [[ -z $1 || ! -d $1 ]]; then
12 echo "Please specify the base directory to store the logs ('$1' not found)"
13 exit -1
14fi
15
16# Create output directory based on given directory + a timestamp
17OUTPUT_DIR=$1"/"`date +"%Y-%m-%dT%H-%M-%S"`
18mkdir ${OUTPUT_DIR}
19
20echo "Copying logs from the robot ${ROBOT_PREFIX}71 and pis ${PI_LIST}"
21echo "Storing logs in folder ${OUTPUT_DIR}"
22
23for pi in $PI_LIST; do
24 echo "========================================================"
25 echo "Copying logs from pi-${ROBOT_PREFIX}71-$pi"
26 echo "========================================================"
27 scp -r pi@10.${ROBOT_PREFIX}.71.10${pi}:${LOG_FILE_PATH} ${OUTPUT_DIR}/fbs_log-pi${pi}
28done
29