This commit is contained in:
Hannes Körber
2019-04-13 20:51:27 +02:00
parent b4d4fbd14a
commit a75335a147

View File

@@ -4,6 +4,11 @@ source ./venv/bin/activate
set -o nounset set -o nounset
set -o errexit set -o errexit
set -o xtrace
bucket="${1}" ; shift
name="${1}" ; shift
backup_source="${1}" ; shift
cleanup() { cleanup() {
rm -f ./keyring.tmp rm -f ./keyring.tmp
@@ -28,12 +33,12 @@ tar \
--xz \ --xz \
--one-file-system \ --one-file-system \
--file - \ --file - \
"${1}" \ "${backup_source}" \
| tmpgpg \ | tmpgpg \
--output - \ --output - \
--encrypt \ --encrypt \
--recipient hannes.koerber@haktec.de \ --recipient 0x078A167A8741BD30 \
| aws s3 cp \ | aws s3 cp \
--storage-class=DEEP_ARCHIVE \ --storage-class=DEEP_ARCHIVE \
- \ - \
s3://de-hkoerber-mycloud-backup/test.tar.xz.gpg s3://${bucket}/${name}-$(date --utc -Iseconds).tar.xz.gpg