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`
|
2016-12-13 18:31:14 -06:00
|
|
|
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
|
2016-12-13 18:31:14 -06:00
|
|
|
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
|
|
|
|
2016-12-13 18:31:14 -06:00
|
|
|
function snapshot {
|
|
|
|
mkdir -vp $SNAPSHOT_D
|
|
|
|
cp -af $OUTPUT_DIR/* $SNAPSHOT_D/
|
|
|
|
}
|
|
|
|
|