This commit is contained in:
Hannes Körber
2019-04-13 21:10:58 +02:00
parent 698a61481f
commit 9de062cc91

View File

@@ -6,13 +6,16 @@ set -o nounset
set -o errexit set -o errexit
set -o xtrace set -o xtrace
export GNUPGHOME=./gpghome
bucket="${1}" ; shift bucket="${1}" ; shift
name="${1}" ; shift name="${1}" ; shift
backup_source="${1}" ; shift backup_source="${1}" ; shift
install --directory --owner $(id -u) --group $(id -g) --mode 700 "${GNUPGHOME}"
cleanup() { cleanup() {
rm -f ./keyring.tmp rm -rf "${GNUPGHOME}"
rm -f ./keyring.tmp~
} }
trap cleanup EXIT trap cleanup EXIT
@@ -20,9 +23,9 @@ trap cleanup EXIT
tmpgpg() { tmpgpg() {
gpg \ gpg \
--batch \ --batch \
--keyring ./keyring.tmp \
--no-default-keyring \ --no-default-keyring \
--no-options \ --no-options \
--trust-model always \
"${@}" "${@}"
} }
@@ -38,7 +41,8 @@ tar \
--output - \ --output - \
--encrypt \ --encrypt \
--recipient 0x078A167A8741BD30 \ --recipient 0x078A167A8741BD30 \
| aws s3 cp \ | aws \
s3 cp \
--storage-class=DEEP_ARCHIVE \ --storage-class=DEEP_ARCHIVE \
- \ - \
"s3://${bucket}/${name}-$(date --utc -Iseconds).tar.xz.gpg" "s3://${bucket}/${name}-$(date --utc -Iseconds).tar.xz.gpg"