First:
- Code: Select all
$ sudo crontab -e
Second, add this to the file in the editor the first command opens:
- Code: Select all
@weekly /usr/local/bin/zpool scrub pool1 pool2
The full path to the zpool command is necessary because /usr/local/bin isn't in root's PATH on macOS. Even if you've modified your OS to change that, it's still good security practice.
Modify the list of pools as is locally appropriate.
It doesn't redirect any output because the command doesn't cause any unless there is a failure to start the scrub. You might want to somehow monitor the output of `zpool status` during the scrub, however.