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 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"