From 74716312d06d54054ad28cc21a7c83984bed5f88 Mon Sep 17 00:00:00 2001 From: goldsquid Date: Fri, 19 Dec 2025 12:15:47 +0700 Subject: [PATCH] follow symlinks when calculating size --- show-file-size.sh | 2 +- show-static-file-size.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/show-file-size.sh b/show-file-size.sh index 4f576310..ef65b815 100755 --- a/show-file-size.sh +++ b/show-file-size.sh @@ -11,7 +11,7 @@ for key in $keys; do prefix="/var/lib/docker/volumes/rpc_$key" - volume_size=$(du -s $prefix 2>/dev/null | awk '{print $1}') + volume_size=$(du -sL $prefix 2>/dev/null | awk '{print $1}') total_size=$((total_size + volume_size)) done diff --git a/show-static-file-size.sh b/show-static-file-size.sh index e0dc035a..52e37c55 100755 --- a/show-static-file-size.sh +++ b/show-static-file-size.sh @@ -12,7 +12,7 @@ for key in $keys; do prefix="/var/lib/docker/volumes/rpc_$key" - volume_size=$(du -s $prefix 2>/dev/null | awk '{print $1}') + volume_size=$(du -sL $prefix 2>/dev/null | awk '{print $1}') total_size=$((total_size + volume_size)) @@ -20,7 +20,7 @@ for key in $keys; do # Check if the path exists if [[ -e "$prefix/_data/$path" ]]; then # Print the size of the file or directory - size=$(du -s "$prefix/_data/$path" 2>/dev/null | awk '{print $1}') + size=$(du -sL "$prefix/_data/$path" 2>/dev/null | awk '{print $1}') static_size=$((static_size + size)) #echo "$path: $size" fi