Skip to content

Instantly share code, notes, and snippets.

@SharkyRawr
Created November 27, 2017 13:53
Show Gist options
  • Select an option

  • Save SharkyRawr/79420e3ef67ad046351346bd8ec70315 to your computer and use it in GitHub Desktop.

Select an option

Save SharkyRawr/79420e3ef67ad046351346bd8ec70315 to your computer and use it in GitHub Desktop.
dump SMART data of all drives into their corresponding textfiles
#! /bin/bash
DRIVES=`ls -l /dev/disk/by-id/ata* | grep -v part | cut -d ' ' -f 10`
for d in $DRIVES; do
NAME=`echo $d | cut -d '/' -f 5`
echo $NAME
smartctl --xall $d > $NAME.txt
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment