From 0d96a49b32ee7bce79d5be2d9188887d35d052dc Mon Sep 17 00:00:00 2001 From: "[799]" Date: Mon, 12 Mar 2018 22:52:28 +0100 Subject: [PATCH] Create qvm-backup-to-appvm Copy files from dom0 to an archive in an AppVM --- qvm-backup-to-appvm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 qvm-backup-to-appvm diff --git a/qvm-backup-to-appvm b/qvm-backup-to-appvm new file mode 100644 index 0000000..9dd75c1 --- /dev/null +++ b/qvm-backup-to-appvm @@ -0,0 +1,19 @@ +#!/bin/bash +# qvm-backup-to-appvm +# Version: 0.1 +# Copy files from dom0 to an archive in an AppVM +# Usage : qvm-backup-to-appvm +# Example: qvm-backup-to-appvm ~/bin my-untrusted /home/user/backup backup.tgz + +Source=$1 +AppVM=$2 +Destination=$3 +Archive=`date +%Y.%m.%d-%H.%M`_$4 + +tar -cvzf /tmp/$Archive $Source +qvm-move-to-vm $AppVM /tmp/$Archive +echo "mv ~/QubesIncoming/dom0/$Archive $Destination && \ + rm ~/QubesIncoming/dom0/qvm-backup_helperscript.sh" >> /tmp/qvm-backup_helperscript.sh +chmod +x /tmp/qvm-backup_helperscript.sh +qvm-move-to-vm $AppVM /tmp/qvm-backup_helperscript.sh +qvm-run $AppVM /home/user/QubesIncoming/dom0/qvm-backup_helperscript.sh