X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=zfs-scrub;h=939c798b4c6339e2e0523a39903b2f0e513afd55;hb=a88b8f570c5a8add46b3ec98cbb8c5556561741e;hp=5d2fadde353aa8c1aa8948d7cee8ff16fd80c5ad;hpb=b9cf1faedfe7f20819b0fcd466a78280d05316e2;p=zfs-ubuntu%2F.git diff --git a/zfs-scrub b/zfs-scrub index 5d2fadd..939c798 100755 --- a/zfs-scrub +++ b/zfs-scrub @@ -6,11 +6,15 @@ # running at any given time. This serializes the zfs # scrub process for any pool. -PATH=/usr/sbin:/sbin:/etc/bin:$PATH +# source our configuration +config="${0%/*}/zfs-scripts.conf" +[ -e "${config}.dist" ] && . ${config}.dist +[ -e "${config}" ] && . ${config} + +exec >> $logdir/zfs-scrub.log 2>&1 pools="$*" maxsleeptime=360 -mailto=root if [ -z "$pools" ]; then echo "-E- Usage: $0 " @@ -36,7 +40,6 @@ do date=`date` echo "$date: Scrub started for zfs pool $i" - zpool import $i zpool scrub $i # Wait until the scrub completes, and check for any errors @@ -60,8 +63,9 @@ do zpool status $i | grep scrub: | grep "with 0 errors" > /dev/null 2>&1 if [ $? != 0 ]; then # The scrub found errors - zpool status $i | /usr/bin/mailx -s "zpool scrub $i found errors" $mailto + zpool status $i | $mailx -s "zpool scrub $i found errors" $mailto fi done +