How to sum up all occupied space by backups from namespaces

pschonmann

Member
Sep 9, 2021
34
2
13
39
Prague
schonmann.eu
Hi, i have structure of pbs - see below. I want to know how much space ocuppied customer1,2,3 etc... by their namespaces because we group their machines there.

Is my code correct or just something missing ?

Code:
root@proxmox-backup:/mnt/datastore/internal/ns/customer1/ns# find  -type f -name 'index.json.blob' -exec proxmox-backup-debug inspect file {} --decode - \; | sed 's/\}size.*/\}/' | grep -v encryption | jq '.unprotected.chunk_upload_stats.size /1024 / 1024 / 1024' | jq -s 'add | "\( . | round * 10 / 10) GB"'
"819 GB"
I dont want to write script thats "du chunks" in their blob files

Is there easier method to do that ?


Code:
/mnt/datastore/internal/
└── ns
    ├── customer1
    │   └── ns
    │       ├── customer1-hw1
    │       ├── customer1-hw2
    │       └── customer1-hw3
    ├── customer2
    │   └── ns
    │       ├── customer2-hw1
    │       ├── customer2-hw2
    │       └── customer2-hw3
    ├── customer3
    │   └── ns
    │       ├── proxmox4
    │       ├── proxmox6
    │       ├── proxmox7
    │       └── proxmox8
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!