Add files via upload

This commit is contained in:
kneutron 2024-04-24 12:49:38 -06:00 committed by GitHub
parent c6a4d54f04
commit 2bdcdc4fcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,17 @@
#!/bin/bash
# REF: https://forum.proxmox.com/threads/determining-free-disk-space-on-windows-vms.145730/#post-656958
[ $(which jq |wc -l) -eq 0 ] && apt install -y jq
# either one works
#qm agent $1 get-fsinfo \
# |jq '[.[] | select(.["total-bytes"]) | {total_gb: ((.["total-bytes"] / (1024 * 1024 * 1024)) | round), used_gb: ((.["used-bytes"] / (1024 * 1024 * 1024)) | round), free_gb: (((.["total-bytes"] - .["used-bytes"]) / (1024 * 1024 * 1024)) | round)}]'
qm guest cmd $1 get-fsinfo \
|jq '[.[] | select(.["total-bytes"]) | {total_gb: ((.["total-bytes"] / (1024 * 1024 * 1024)) | round), used_gb: ((.["used-bytes"] / (1024 * 1024 * 1024)) | round), free_gb: (((.["total-bytes"] - .["used-bytes"]) / (1024 * 1024 * 1024)) | round)}]'
date
exit;