From 9d414b123bebfb4e746259d502eb8d4e4f63fa61 Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Tue, 19 Mar 2024 06:42:01 +0100 Subject: [PATCH] fix --- check-disk-space.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/check-disk-space.sh b/check-disk-space.sh index f1f69983..373ce839 100755 --- a/check-disk-space.sh +++ b/check-disk-space.sh @@ -1,7 +1,7 @@ #!/bin/bash # Threshold for disk usage percentage -threshold=90 +threshold=10 # Get the list of mounted filesystems and their usage, excluding pseudo, duplicate, inaccessible file systems, and tmpfs filesystems=$(df -h -x tmpfs --output=target,pcent | tail -n +2) @@ -12,6 +12,11 @@ while IFS= read -r line; do filesystem=$(echo "$line" | awk '{print $1}') usage=$(echo "$line" | awk '{print $NF}' | tr -d '%') + # Exclude Docker container overlay filesystems + if [[ "$filesystem" == *overlay* ]]; then + continue + fi + # Check if usage is a number if [[ $usage =~ ^[0-9]+$ ]]; then # Check if usage is above the threshold