Modified dir name in gitignore and changed disk info example.

This commit is contained in:
2025-02-28 15:18:57 +01:00
parent f5453353fe
commit f1df522f61
2 changed files with 3 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
*.conf *.conf
venv venv
meshbooks books
.vscode .vscode
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
+2 -7
View File
@@ -1,13 +1,8 @@
--- ---
name: Use DF to get drive information in JSON. name: Use DF to get drive information in JSON.
groups: Placeholder group: Systemec Development
target_os: "Linux" target_os: "Linux"
tasks: tasks:
- name: Get disk-info with df returning JSON. - name: Get disk-info with df returning JSON.
command: > command: >
df -Th -x overlay -x tmpfs -x devtmpfs | \ df -Th -x overlay -x tmpfs -x devtmpfs | awk 'NR>1 {printf "%s{\"size\":\"%s\",\"used\":\"%s\",\"available\":\"%s\",\"mount_point\":\"%s\",\"type\":\"%s\"}", (NR==2?"[":","), $3, $4, $5, $7, $2} END {print "]"}'
awk 'NR==1 || $1 ~ ".+"{print $3, $4, $5, $7, $2}' | \
awk 'NR>1 {printf "{\"size\":\"%s\",\"used\":\"%s\",\"available\":\"%s\",\"mount_point\":\"%s\",\"type\":\"%s\"},", $1, $2, $3, $4, $5}' | \
sed '$ s/,$//' | \
awk 'BEGIN {printf "["} {printf "%s", $0} END {printf "]"}'
exit