Rule for /etc/monit/monitrc:
Code: Select all
# BTRFS File System Integrity
check program btrfsintegritycheck with path "/etc/monit/scripts/btrfsintegritycheck.sh"
with timeout 1800 seconds
# Run at 4am each day
every "0 4 * * *"
if status != 0 then alert
/etc/monit/scripts/btrfsintegritycheck.sh
Code: Select all
#!/bin/bash
btrfs scrub start -Br / | grep -e 'no errors found' -e 'with 0 errors'