X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;f=zfs-scrub;h=b82b90028a8b06accaae1e0e7dc5c5c8cb74583a;hb=36a6b1d45377ec5022e3d05e3282d4fee25352a0;hp=f022a54d1c86272edd2c664e2d2ddd8d29504d09;hpb=db345818e94a6ed712b6be68c3204e60c6972773;p=zfs-ubuntu%2F.git diff --git a/zfs-scrub b/zfs-scrub index f022a54..b82b900 100755 --- a/zfs-scrub +++ b/zfs-scrub @@ -6,14 +6,18 @@ # That only 1 scrub operation is running at any given time. # This serializes the zfs scrub process for each pool. +PATH=/usr/sbin:/sbin:$PATH + +pools="tank storage" maxsleeptime=360 +logfile=/var/log/zfs/zfs-scrub.log -for i in tank storage +for i in $pools do # Check to see if this zfs filesystem has a scrub being performed on it now. # If it does, we cannot perform more than one scrub operation at a time. while true; do - /sbin/zpool status | grep scrub: | grep "in progress" > /dev/null 2>&1 + zpool status | grep scrub: | grep "in progress" > /dev/null 2>&1 if [ $? == 0 ]; then # Another zpool scrub operation is already running # Wait until it is done before continuing @@ -25,7 +29,9 @@ do fi done - echo "Scrubing zfs pool $i" - /sbin/zpool scrub $i + date=`date` + echo "$date: Scrub started for zfs pool $i" >> $logfile + zpool scrub $i + sleep 60 done