Move zfs-scrub template to git-crypt file

This commit is contained in:
Benoit S 2021-09-04 21:43:32 +09:00
parent 76c4ae6531
commit 999b601432
3 changed files with 5 additions and 4 deletions

18
files/zfs-scrub.sh_clear Normal file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# https://serverfault.com/questions/538978/how-to-run-a-command-once-a-zfs-scrub-completes
set -euo pipefail
curl -m 10 --retry 5 <healthchecks_url>/start
zpool scrub local
# wait until scrub is finished
while zpool status local | grep -q 'scan: *scrub in progress'; do
zpool status local
sleep 600
done
zpool status local
# Get stdout from journalctl
LOG=$(journalctl -o cat -u zfs-scrub.service -n 100)
curl -fsS -m 10 --retry 5 --data-raw "$LOG" <healthchecks_url>
exit 0