From 3a5c890bb0df369733782a5196d8f81c176787f5 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 14 Sep 2011 23:36:10 +0000 Subject: [PATCH] dump start data into git git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@274 191e9f34-6774-4a6d-acfc-7664dacd4a2a --- recepies/smart/dump.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 recepies/smart/dump.sh diff --git a/recepies/smart/dump.sh b/recepies/smart/dump.sh new file mode 100755 index 0000000..9ea7eb0 --- /dev/null +++ b/recepies/smart/dump.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e + +# cron +# */30 * * * * /mnt/smart/dump.sh + +cd /srv/sysadmin-cookbook/recepies/smart +# awk '{ if ( $3 >= 2930266584 ) print $4 }' + +driver="-d megaraid,0" + +cat /proc/partitions | grep ' sd.$' | awk '{ print $4 }' | xargs -i sudo sh -cx "smartctl $* $driver -a /dev/{} > smart.{}" +git commit -m `date +%Y-%m-%d.%H:%M:%S` -a -- 2.20.1