# running at any given time. This serializes the zfs
# scrub process for any pool.
-exec >> /var/log/zfs/zfs-scrub.log 2>&1
+# source our configuration
+config="${0%/*}/zfs-scripts.conf"
+[ -e "${config}.dist" ] && . ${config}.dist
+[ -e "${config}" ] && . ${config}
-PATH=/usr/sbin:/sbin:/etc/bin:$PATH
+exec >> $logdir/zfs-scrub.log 2>&1
pools="$*"
maxsleeptime=360
-mailto=root
if [ -z "$pools" ]; then
echo "-E- Usage: $0 <pools>"
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