projects
/
zfs-nexenta
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed cleanup() trap to be based on INT signal instead of EXIT
[zfs-nexenta/.git]
/
zfs-scrub-usb-drive
diff --git
a/zfs-scrub-usb-drive
b/zfs-scrub-usb-drive
index 8a07e5cae10d8c533b6cde8a64fa57a28587bf94..6136fab09767fef0bba5cd14c9cae30502aa679d 100755
(executable)
--- a/
zfs-scrub-usb-drive
+++ b/
zfs-scrub-usb-drive
@@
-8,6
+8,7
@@
maxsleeptime=360
mailto=root
maxsleeptime=360
mailto=root
+logfile=/var/log/zfs/zfs-scrub.log
for i in backups
do
for i in backups
do
@@
-26,8
+27,9
@@
do
fi
done
fi
done
- echo "Scrubing zfs pool $i"
- /usr/local/etc/bin/usb-drive-power on
+ date=`date`
+ echo "$date: Scrub started for zfs pool $i" >> $logfile
+ /usr/local/etc/bin/usb-drive-power on >> /dev/null
/sbin/zpool import $i
/sbin/zpool scrub $i
/sbin/zpool import $i
/sbin/zpool scrub $i
@@
-45,6
+47,9
@@
do
fi
done
fi
done
+ date=`date`
+ echo "$date: Scrub completed for zfs pool $i" >> $logfile
+
# Check for any scrub errors
/sbin/zpool status $i | grep scrub: | grep "with 0 errors" > /dev/null 2>&1
if [ $? != 0 ]; then
# Check for any scrub errors
/sbin/zpool status $i | grep scrub: | grep "with 0 errors" > /dev/null 2>&1
if [ $? != 0 ]; then
@@
-54,7
+59,7
@@
do
# Power off the USB drive
/sbin/zpool export $i
# Power off the USB drive
/sbin/zpool export $i
- /usr/local/etc/bin/usb-drive-power off
+ /usr/local/etc/bin/usb-drive-power off
>> /dev/null
done
done