Reflexion about qubes backups

if i get a lot of different qubes backups it is difficult to restore the right one due to the filename formatting (qubes-backup-2021-04-30T132751)

has anyone ever thought of saving the correspondence between the real name of the vm and the corresponding backup using the time stamp (by a file located in the home of dom0 for example)?

is it possible and how to automate that for backup and restore?

This isn’t pretty but it may help inspire -

#!/bin/bash
num_inputs=$#
input=( "$@" )
target=${input[-2]}
store=${input[-1]}
qubes=(${input[@]:0:$num_inputs-2})
names=`printf '_%s' "${qubes[@]}"`
qvm-backup --quiet --yes --dest-vm $target --passphrase-file <PATH>  --compress $store ${qubes[@]}
str="ls -tr $store/qubes-backup*|tail -n1"
filename=`qvm-run -p $target "$str"`
qvm-run $target "mv $filename $filename$names"

If you save as backup, you call like this:
backup <list of qubes to back up> <qube to store backup> <path to store>

It will append to the dated backup the names of the qubes that are
included.

2 Likes

Thank you very much @unman, you are very generous with your time.