hw-test/scripts/scan-dmidecode

21 lines
437 B
Text
Raw Normal View History

2016-12-12 12:25:14 -06:00
#!/bin/bash
2016-12-12 13:31:26 -06:00
MY_SERIAL=`dmidecode -s chassis-serial-number`
MY_DATETIME=`date +%Y-%m-%d_%H-%M-%S`
OUTPUT_HOME=/output/hwtests
OUTPUT_DIR=$OUTPUT_HOME/$MY_SERIAL
SNAPSHOT_D=$OUTPUT_HOME/snapshot/$MY_SERIAL/$MY_DATETIME
2016-12-12 13:31:26 -06:00
export OUTPUT_DIR
export SNAPSHOT_D
mkdir -p $OUTPUT_DIR
2016-12-12 13:31:26 -06:00
if [ ! -f $OUTPUT_DIR/dmidecode ] ; then
dmidecode > $OUTPUT_DIR/dmidecode
fi
2016-12-12 12:25:14 -06:00
function snapshot {
mkdir -vp $SNAPSHOT_D
cp -af $OUTPUT_DIR/* $SNAPSHOT_D/
}