# Scrubbing is the process of checking file consistency.
# Scrubbing may be done "online", meaning you don't need to unmount a subvolume to scrub it.
# https://nixos.wiki/wiki/Btrfs#Scrubbing
# Btrfs scrub is "[a]n online filesystem checking tool. Reads all the data and metadata on the filesystem and uses checksums and the duplicate copies from RAID storage to identify and repair any corrupt data."
# https://wiki.archlinux.org/title/btrfs#Scrub
# The scrub command operates on a whole filesystem, not just individual subvolumes.
# https://unix.stackexchange.com/a/724412
#
# As this command reads all data, it wears down the disk. One should not run it too often. For large, slow disks once per month should be fine.
# Important: Wake up at ~ same time as daily-backup-and-suspend.service to avoid system being powered on longer than necessary.
# Value: Each month on the 1st day at 12:00 - 5 minutes before daily-backup-and-suspend
# TODO: Let's see next month if this works. Maybe it doesn't if "resume from suspend" is still not finished when the scrub service is already being started. The latter conflicts with suspend. The idea is that it stops scrubbing when suspend is started. But maybe this prohibits us from "waking up to start scrub service"? We'll find out!