Uwe Kubosch 944904a
#!/bin/bash
Uwe Kubosch 944904a
#
Uwe Kubosch 944904a
# This script reads it's configuration from /etc/sysconfig/zfs-fuse
Uwe Kubosch 944904a
# Please use that file to enable/disable this script or to set the
Uwe Kubosch 944904a
# type of check you wish performed.
Uwe Kubosch 944904a
Uwe Kubosch 944904a
[ -f /etc/sysconfig/zfs-fuse ] || exit 0
Uwe Kubosch 944904a
. /etc/sysconfig/zfs-fuse
Uwe Kubosch 944904a
Uwe Kubosch 944904a
[ "$ZFS_WEEKLY_SCRUB" != "yes" ] && exit 0
Uwe Kubosch 944904a
Uwe Kubosch 944904a
zpool=/usr/bin/zpool
Uwe Kubosch 944904a
Uwe Kubosch 86626cf
pools=`$zpool list -H | cut -f1`
Uwe Kubosch 944904a
Uwe Kubosch a754924
if [ "$pools" != "" ] ; then
Uwe Kubosch a754924
    echo Found these pools: $pools
Uwe Kubosch 944904a
Uwe Kubosch a754924
    for pool in $pools; do
Uwe Kubosch a754924
	echo "Starting scrub of pool $pool"
Uwe Kubosch a754924
	$zpool scrub $pool
Uwe Kubosch a754924
    done
Uwe Kubosch 944904a
Uwe Kubosch a754924
    echo "ZFS Fuse automatic scrub start done.  Use '$zpool status' to see progress."
Uwe Kubosch a754924
fi