stacks/homelab/btrfs-scrub/run

18 lines
289 B
Bash
Executable File

#! /bin/sh
set -e
# Wait 7 days
sleep 7d
# Wait until it's after 10pm
while [ $(TZ=US/Mountain date +%H) -lt 22 ]; do
sleep 10m
done
# Limit scrub speed to 100m. Is this a good limit? I don't know!
btrfs scrub limit --limit 100m --all /sys
# Start the scrub!
btrfs scrub start /sys