Periodical scrubbing, one pool at a time

Hello,
Do you know if there is an easy way to enable periodical scrubbing, such as started by cron, but only if no other scrubs are active?

The reason I want to do this, is that I have a disk with two partitions, where partition 1 is a member of pool A and partition 2 is a member of pool B. I do not want both partitions to be scrubbed at the same time.

1 Like

You’ll need to write a wrapper script using zpool status to check to see if the other pool is scrubbing. Not too difficult; you’ll want to pass it through grep and sed or possibly awk to get the relevant bit from zpool status on pool A to decide whether to then run zpool scrub on pool B (and vice versa).

Or just be lazy, figure out how long they usually take to run, and do a simple staggered rotation in cron, eg scrub A on the first of every month and B on the fifteenth. Simpler. And if they don’t complete in less than fifteen days, you can’t do them both in a month anyway, so…