From 2a562a3283076c7a62dee024e4da3d30f476b2a6 Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Fri, 23 Dec 2016 02:26:44 -0600 Subject: [PATCH] recover summary from badblocks.out for snapshot purposes --- scripts/wrapper-badblocks | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/scripts/wrapper-badblocks b/scripts/wrapper-badblocks index 507aa3c..e713dc9 100755 --- a/scripts/wrapper-badblocks +++ b/scripts/wrapper-badblocks @@ -139,10 +139,25 @@ if [[ -f $OUTPUT_DIR/disk/$SERIAL.badblocks ]] ; then ln -sf $OUTPUT_DIR/disk/$SERIAL.badblocks \ $OUTPUT_DIR/disk/$DISK.badblocks fi -#if [[ -f $OUTPUT_DIR/disk/$SERIAL.badblocks.out ]] ; then -# ln -sf $OUTPUT_DIR/disk/$SERIAL.badblocks.out \ -# $OUTPUT_DIR/disk/$DISK.badblocks.out -#fi +if [[ -f /run/$SERIAL.badblocks.out ]] ; then +# strings /run/$SERIAL.badblocks.out \ +# | sed 's/\s\+[0-9.%]\+ done, [0-9:]\+ elapsed.//' \ +# | uniq > $OUTPUT_DIR/disk/$SERIAL.badblocks.out + date > $OUTPUT_DIR/disk/$SERIAL.badblocks.out + strings /run/$SERIAL.badblocks.out \ + | grep -B5 -A5 Testing \ + >> $OUTPUT_DIR/disk/$SERIAL.badblocks.out + echo "..." >> $OUTPUT_DIR/disk/$SERIAL.badblocks.out + strings /run/$SERIAL.badblocks.out \ + | grep -B5 -A5 Reading \ + >> $OUTPUT_DIR/disk/$SERIAL.badblocks.out + echo "..." >> $OUTPUT_DIR/disk/$SERIAL.badblocks.out + strings /run/$SERIAL.badblocks.out \ + | grep -B5 -A5 completed \ + >> $OUTPUT_DIR/disk/$SERIAL.badblocks.out + ln -sf $OUTPUT_DIR/disk/$SERIAL.badblocks.out \ + $OUTPUT_DIR/disk/$DISK.badblocks.out +fi #ln -sf $OUTPUT_DIR/disk/$SERIAL.badblocks.ret \ # $OUTPUT_DIR/disk/$DISK.badblocks.ret ln -sf $OUTPUT_DIR/disk/$SERIAL.badblocks.result \