From 9c4e78fef95ce419c602cb9c3742c4de7670c4f2 Mon Sep 17 00:00:00 2001 From: Boris Gallet Date: Mon, 30 Sep 2024 11:40:21 +0200 Subject: [PATCH] new: [0km] add flag -n nextcloud size and -d docker system size in vps-space --- bin/0km | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/bin/0km b/bin/0km index 5057b0a..1829895 100755 --- a/bin/0km +++ b/bin/0km @@ -1397,8 +1397,35 @@ cmdline.spec::cmd:vps-space:run() { : :posarg: [VPS...] 'Target host(s) to check' + : :optfla: --nextcloud,-n 'target space used by nextcloud and total size of trashfiles' + : :optfla: --docker,-d 'target space used by docker' + echo "df /srv -h | tail -n +2 | sed -r 's/ +/ /g' | cut -f 2-5 -d ' '" | vps_mux vps_bash "${VPS[@]}" + + if [ -n "$opt_nextcloud" ]; then + echo " + NEXTCLOUD_TRASH_DIR=\"/srv/datastore/data/nextcloud/var/lib/nextcloud/data/*/files_trashbin\" + echo \"---- Nextcloud data size : \" + du -sh /srv/datastore/data/nextcloud/ + echo \"---- Nextcloud thrashbin files size (MB) : \" + du -sk /srv/datastore/data/nextcloud/var/lib/nextcloud/data/*/files_trashbin | awk '{sum += \$1} END {print sum / 1024}' + echo \"---- Trashbin group files (MB) : \" + du -sk /srv/datastore/data/nextcloud/var/lib/nextcloud/data/*/files_trashbin/* | awk '{sum += \$1} END {print sum / 1024}' + " | + vps_mux vps_bash "${VPS[@]}" + fi + + if [ -n "$opt_docker" ]; then + echo " + echo \"---- Docker sytem disk usage ---- \" + docker system df + echo \"---- Docker containers logs size : \" + du -h max-depth=1 /var/lib/docker/containers/* | sort -h + " | + vps_mux vps_bash "${VPS[@]}" + fi + } -- 2.30.2