proxmox-backup-client snapshot list should list backups chronologically

ubu

Renowned Member
Nov 24, 2017
481
110
83
50
proxmox-backup-client snapshot list --output-format=json-pretty should list backups chronologically, and i am pretty shure it did some time ago
 
it does still here, but sorted first by type/id

so

vm/100/<snapshot1>
vm/100/<snapshot2>
vm/101/<snapshot1>
...

etc.

what does it show in your case?
 
proxmox-backup-client snapshot list ct/202 DOES list them chronologically.

With --output-fomat this is no longer the case:

date -u -d @`proxmox-backup-client snapshot list ct/202 --output-format=json |jq -j '.[0]."backup-time"'` +%FT%TZ

should show the latest entry (and did in the past) but now shows a random entry
 
you're right, but this can be solved on the client side e.g. with:

Code:
proxmox-backup-client snapshot list ct/ID --output-format json | jq 'sort_by(."backup-time")'

you can ofc open a bug report (https://bugzilla.proxmox.com) , but i guess this is simply done to be faster (since we read the snapshots in order we get it from the disk) and sorting would slow down the api request