From 9de062cc913f8360be998dd3a3ffe4f07b2bce78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 13 Apr 2019 21:10:58 +0200 Subject: [PATCH] tmp --- backup.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backup.sh b/backup.sh index 45c5b63..53acf3f 100755 --- a/backup.sh +++ b/backup.sh @@ -6,13 +6,16 @@ set -o nounset set -o errexit set -o xtrace +export GNUPGHOME=./gpghome + bucket="${1}" ; shift name="${1}" ; shift backup_source="${1}" ; shift +install --directory --owner $(id -u) --group $(id -g) --mode 700 "${GNUPGHOME}" + cleanup() { - rm -f ./keyring.tmp - rm -f ./keyring.tmp~ + rm -rf "${GNUPGHOME}" } trap cleanup EXIT @@ -20,9 +23,9 @@ trap cleanup EXIT tmpgpg() { gpg \ --batch \ - --keyring ./keyring.tmp \ --no-default-keyring \ --no-options \ + --trust-model always \ "${@}" } @@ -38,7 +41,8 @@ tar \ --output - \ --encrypt \ --recipient 0x078A167A8741BD30 \ - | aws s3 cp \ + | aws \ + s3 cp \ --storage-class=DEEP_ARCHIVE \ - \ "s3://${bucket}/${name}-$(date --utc -Iseconds).tar.xz.gpg"