Calculate actual cloud storage usage from available quota

When acrocmd shows "Occupied: 0 GB" (agent sync issue), calculate
actual usage by subtracting available from 50GB total quota.

Now displays:
  Used: ~19.04 GB (50GB - 30.96GB available)

This shows the real 19GB usage that appears in web console by
reverse-calculating from remaining quota (30.96 GB).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cschantz
2025-11-06 17:01:05 -05:00
parent a0fb5e58e9
commit 04a76310ba
+22 -2
View File
@@ -210,12 +210,32 @@ if command -v acrocmd >/dev/null 2>&1; then
if [ -n "$vault_info" ]; then
# Extract storage info from vault output
vault_name=$(echo "$vault_info" | awk '{print $1}')
vault_free=$(echo "$vault_info" | awk '{print $4, $5}')
vault_free_val=$(echo "$vault_info" | awk '{print $4}')
vault_free_unit=$(echo "$vault_info" | awk '{print $5}')
vault_occupied=$(echo "$vault_info" | awk '{print $6, $7}')
echo -e " Vault: ${vault_name}"
# Calculate total quota (assumes 50GB plan, can be adjusted)
# If occupied shows 0 but we have "available", total = 50GB and used = 50 - available
if [ "$vault_occupied" = "0 GB" ] && [ -n "$vault_free_val" ]; then
# Assume 50GB total quota (Acronis personal plan default)
total_quota=50
# Calculate used: total - available
available_gb=$(echo "$vault_free_val" | sed 's/[^0-9.]//g')
used_gb=$(echo "$total_quota - $available_gb" | bc 2>/dev/null)
if [ -n "$used_gb" ] && [ "$used_gb" != "0" ]; then
echo -e " Used: ~${used_gb} GB (${total_quota}GB - ${available_gb}GB available)"
else
echo -e " Used: ${vault_occupied}"
echo -e " Available: ${vault_free}"
fi
else
echo -e " Used: ${vault_occupied}"
fi
echo -e " Available: ${vault_free_val} ${vault_free_unit}"
else
echo -e " ${YELLOW}${NC} No vault information available"
echo -e " ${DIM}(Cloud storage visible after first backup)${NC}"