From 695e360d072c2fd4572279dfbadf1560b7e29562 Mon Sep 17 00:00:00 2001 From: bsourisse Date: Sun, 20 Aug 2023 20:54:27 +0200 Subject: [PATCH] feat: get storage with single unix user --- helpers/shells/getStorageUsed.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/helpers/shells/getStorageUsed.sh b/helpers/shells/getStorageUsed.sh index 25adedc..106c758 100755 --- a/helpers/shells/getStorageUsed.sh +++ b/helpers/shells/getStorageUsed.sh @@ -14,6 +14,14 @@ # Exit when any command fails set -e +# Load .env if exists +if [[ -f .env ]]; then + source .env +fi + +# Default value if .env not exists +: "${home:=/home/borgwarehouse}" + # Use jc to output a JSON format with du command -cd /var/borgwarehouse -sudo /usr/bin/du -s -- * | jc --du +cd ${home}/repos +du -s -- * | jc --du