Also note that Backblaze lifecycle rules take 24 to 48 hours to kick in. Acording to this blog https://blog.tymscar.com/posts/backblazeb2cleanup/
In my case, after I changed Lifecycle setting from: “Keep all versions” to “Keep only the last version” take 24 hrs to remove old versions, and the reduce the space
Commands to check space used:
# Get file count and space used by bucket
b2 bucket get mybucket --show-size | grep -iE “bucketname|totalsize|filecount”
"bucketName": "mybucket",
"fileCount": 42710,
"totalSize": 30,284,830,374
# List current files
b2 ls -r -l “b2://mybucket/” | awk ‘{sum += $5} END {printf “%.0f\n”, sum}’
4,181,535,577
# List all versions and deleted/hidden files
b2 ls -r -l --versions “b2://mybucket/” | awk ‘{sum += $5} END {printf “%\047.0f\n”, sum}’
30,284,830,374
After change lifecycle policy AND WAIT 24 hours, the space was reduced to the actual files in kopia repository
b2 bucket get mybucket --show-size | grep -iE "bucketname|totalsize|filecount"
"bucketName": "mybucket",
"fileCount": 1461,
"totalSize": 4907139347
b2 ls -l --versions "b2://mybucket/" | wc -l
1461
b2 ls -l --versions "b2://mybucket/" | awk '{sum += $5} END {printf "%\047.0f\n", sum}'
4,907,139,347
Very close to kopia stats
kopia blob stats
Count: 669
Total: 4.2 GB
Average: 6.3 MB
Histogram:
0 between 0 B and 10 B (total 0 B)
4 between 10 B and 100 B (total 135 B)
9 between 100 B and 1 KB (total 3.5 KB)
87 between 1 KB and 10 KB (total 466.4 KB)
39 between 10 KB and 100 KB (total 1.4 MB)
331 between 100 KB and 1 MB (total 194 MB)
7 between 1 MB and 10 MB (total 26.7 MB)
192 between 10 MB and 100 MB (total 4 GB)
So my space went from 30G to 4.9 G because I have snapshots since 2023, but no useful anymore, I just keep 21 daily and 3 monthly snapshots
kopia policy show --global
Policy for (global):
Retention:
Annual snapshots: 0 (defined for this target)
Monthly snapshots: 3 (defined for this target)
Weekly snapshots: 0 (defined for this target)
Daily snapshots: 21 (defined for this target)
Hourly snapshots: 0 (defined for this target)
Latest snapshots: 21 (defined for this target)
Ignore identical snapshots: false (defined for this target)
...