-
Notifications
You must be signed in to change notification settings - Fork 2
/
upload.sh
executable file
·43 lines (40 loc) · 1.15 KB
/
upload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# safety settings
set -u
set -e
set -o pipefail
# This script uploads all scripts from dom0 to a VM mentioned in repo_vm file
PACK=(
backup backup.py
install-backup-storage-vm install-backup-storage-vm.py
backupbackends/basic.py
backupbackends/dvmbased.py
backupbackends/duplicity.py
backupbackends/duplicity-vm-files/vm-backup-agent
backupbackends/duplicity-vm-files/vm-restore-agent
backupbackends/duplicity-vm-files/qubesintervmbackend.py
backupbackends/duplicity-vm-files/backup-storage-agent/v6-qubes-backup-poc.py
backupbackends/duplicity-vm-files/backup-storage-agent/list-backups.py
backupbackends/duplicity-vm-files/common.py
upload.sh
qubesvmtools.py
backupconfig.py
cryptopunk.py
backupsession.py
tests/backupsessiontest.py
Makefile
)
IGNORE=(
repo_vm
testconfig
__pycache__
backupbackends/__pycache__
tests/__pycache__
backupbackends/qvmbackup.py.notdone
)
if ! diff <(find "${PACK[@]}" "${IGNORE[@]}" -type f -or -type l | sort) <(find -type f -or -type l | sed 's#^\./##' | sort); then
echo not continuing…
exit 1
fi
echo uploading
tar czf - "${PACK[@]}" | qvm-run -p -a "$(cat repo_vm)" 'cd backup-tools; tar xzf -'