created health check for btrfs

This commit is contained in:
2022-01-30 13:22:47 +01:00
parent a90e02ce02
commit 597a0ab9ad
8 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Check btrfs status
OnFailure=systemd-email@%n.service
OnSuccess=systemd-email@%n.service
[Service]
Type=oneshot
ExecStart=/bin/bash /home/administrator/scripts/btrfs-health-check/btrfs-health-check.sh

View File

@@ -0,0 +1,6 @@
#!/bin/bash
# Checks the healt of all btrfs volumes
for path in $(btrfs filesystem show | awk '/ path /{print $NF}')
do
btrfs device stats $path
done

View File

@@ -0,0 +1,8 @@
[Unit]
Description=starts btrfs-health-check.service
[Timer]
OnCalendar=12:00
[Install]
WantedBy=timers.target