mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-30 05:02:54 +08:00
Add files via upload
This commit is contained in:
parent
c6a4d54f04
commit
2bdcdc4fcb
17
proxmox/proxmox-windows-vm-free-disk-space.sh
Normal file
17
proxmox/proxmox-windows-vm-free-disk-space.sh
Normal 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user