Automated monthly ZFS pool scrubbing

Tested on solaris 11.1, but should work 10 and up.

Just a quick shell script and cron job to perform a monthly scrub of all pools in your system. Whether this is appropriate or not depends on the frequency of data reads in your system and whether they would pick up any potential data corruption or hardware issues.

scrub-all.sh

#!/usr/bin/bash

export PATH=/usr/sbin:/usr/bin

zpool list -H -o name | while read pool; do
    zpool scrub $pool
 done
`</pre> 

Example cron entry to run this monthly:
 <pre>`#M H d m w 
10 2 1 * * /home/tdehesse/bin/scrub-all.sh