Proxmox Backup Client Restore

beerygaz

Member
Nov 12, 2020
2
0
6
53
I there a command line paramter to restore the latest backup using a combination of the
Code:
proxmox-backup-client snapshot list
proxmox-backup-client restore
command? without a lot for regex parsing? Do I need to get a snapshot list, output to JSON, parse that JSON for the latest snapshot and then pass that back as a parameter to the restore command? Trying not to re-invent the wheel here.
 
fyi: the client nearly always has a '--output-format' option that you can set to e.g. json, which makes it much easier to parse/traverse with tools like e.g. 'jq'
 
I hope it is ok, that I reactivate this old thread.

Trying to do the same: Export the latest backups to an external storage, to have a backup independent of PBS. But do not get how I can do it.

This command to list all latest snapshots is working:
proxmox-backup-client snapshot list --repository Backup | awk '{print $1, $2}' | grep 'vm/' | sort -t/ -k2,2 -k3,3r | sort -u -t/ -k2,2

Example Output:
│ vm/108/2024-12-17T03:18:26Z
│ vm/109/2024-12-20T05:08:31Z
│ vm/111/2024-12-20T05:11:01Z
│ vm/112/2024-12-17T04:02:59Z

Now I want to restore all files from vm/112/2024-12-17T04:02:59Z
It seems, that I need to do it separate for every archive in the backup.
For that I would need to get a list of them, but catalog dump gives an error:

Code:
proxmox-backup-client catalog dump vm/112/2024-12-17T04:02:59Z --repository Backup
Error: Unable to open dynamic index "/mnt/backup/vm/112/2024-12-17T04:02:59Z/catalog.pcat1.didx" - No such file or directory (os error 2)

How could I do it?