"add" without argument should propose missing volumes from actual config
Right now, I do something like this which is buggy cause it introduces root volumes for VMs that are not TemplateVMs:
qvm-volume list --quiet|grep -v volatile|awk -F "/" {'print $2'}|awk -F " " {'print $1'}|while read line; do sudo ~/sparsebak/sparsebak.py add $line; done
In the meantime, this gets you much closer:
qvm-volume list --quiet|grep '^lvm:\S+-private\s'|awk -F "/" {'print $2'}|awk -F " " {'print $1'}|while read line; do sudo ~/sparsebak/sparsebak.py add $line; done
grep '^lvm:\S+-private\s'
That part doesn't return anything :)
Sorry, I omitted that it should be run as grep -E.
Trick to add TemplateVMs missing root volumes
TEMPLATEVMS=$(qvm-ls --fields NAME,CLASS|grep TemplateVM|awk -F " " {'print $1'})
qvm-volume list --quiet|grep -E '^lvm:\S+-root\s'|awk -F "/" {'print $2'}|awk -F " " {'print $1'}|while read volume; do echo "$TEMPLATEVMS"|while read templatevm; do echo "$volume" |grep "$templatevm";done; done|while read line; do sudo ~/sparsebak/sparsebak.py add $line; done
I think this one will need a little extra thought because to list all the *root and *private volumes on a Qubes system would be overwhelming to users. It should detect if its running in Qubes dom0 and then filter volumes according to their VM type (Ex: template-based AppVMs have only the private vol displayed).
Meanwhile, those work.
qvm-volume list --quiet|grep -E '^lvm:\S+-private\s'|awk -F "/" {'print $2'}|awk -F " " {'print $1'}|while read line; do sudo /home/user/wyng-backup-master/wyng add $line; done
TEMPLATEVMS=$(qvm-ls --fields NAME,CLASS|grep TemplateVM|awk -F " " {'print $1'})
qvm-volume list --quiet|grep -E '^lvm:\S+-root\s'|awk -F "/" {'print $2'}|awk -F " " {'print $1'}|while read volume; do echo "$TEMPLATEVMS"|while read templatevm; do echo "$volume" |grep "$templatevm";done; done|while read line; do sudo /home/user/wyng-backup-master/wyng add $line; done
Wyng cannot second-guess a users' particular OS or application environment (there are many ways to organize container volumes), so this function is best handled by wrappers and front-ends that are aware of a specific environment, such as wyng-util-qubes using the VM backup flag to backup new VMs.