Modified dir name in gitignore and changed disk info example.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
*.conf
|
*.conf
|
||||||
venv
|
venv
|
||||||
meshbooks
|
books
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user