wyng-backup icon indicating copy to clipboard operation
wyng-backup copied to clipboard

"add" without argument should propose missing volumes from actual config

Open tlaurion opened this issue 6 years ago • 6 comments

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

tlaurion avatar Jul 10 '19 19:07 tlaurion

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

tasket avatar Jul 10 '19 22:07 tasket

grep '^lvm:\S+-private\s'

That part doesn't return anything :)

tlaurion avatar Jul 12 '19 21:07 tlaurion

Sorry, I omitted that it should be run as grep -E.

tasket avatar Jul 13 '19 00:07 tasket

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

tlaurion avatar Aug 17 '19 20:08 tlaurion

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).

tasket avatar Jan 31 '20 19:01 tasket

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

tlaurion avatar Feb 07 '20 22:02 tlaurion

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.

tasket avatar Jun 14 '23 23:06 tasket