From 47adb12689ba029403c0c003c0508576f0872c49 Mon Sep 17 00:00:00 2001 From: matthias Date: Mon, 24 Feb 2020 15:19:09 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=9Ebackup.sh=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backup.sh b/backup.sh index 697f9c8..96c4818 100644 --- a/backup.sh +++ b/backup.sh @@ -49,13 +49,18 @@ gpg --trust-model always --enable-progress-filter --output ~/$BACKUP_FILENAME.gp rm ~/$BACKUP_FILENAME echo "uploading" -aws s3 cp ~/$BACKUP_FILENAME.gpg s3://$S3_BUCKET_NAME/$BACKUP_FILENAME.gpg --storage-class DEEP_ARCHIVE || healthchck_fail "Upload Failed" +AWS_ENDPOINT_OPTION= +if [ "$AWS_USE_MINIO" -eq 1 ] ; then + aws configure set default.s3.signature_version s3v4 + AWS_ENDPOINT_OPTION=--endpoint-url https://${MINIO_ENDPOINT} +fi +aws ${AWS_ENDPOINT_OPTIOM} s3 cp ~/$BACKUP_FILENAME.gpg s3://$S3_BUCKET_NAME/$BACKUP_FILENAME.gpg --storage-class DEEP_ARCHIVE || healthchck_fail "Upload Failed" rm ~/$BACKUP_FILENAME.gpg echo "done" # On first month day do if [ "$month_day" -eq 1 ] ; then echo "make monthly backup" - aws s3 cp s3://$S3_BUCKET_NAME/$BACKUP_FILENAME.gpg s3://$S3_BUCKET_NAME/$BACKUP_FILENAME_MONTHLY.gpg --storage-class DEEP_ARCHIVE || healthchck_fail "failed to create monthly backup" + aws ${AWS_ENDPOINT_OPTIOM} s3 cp s3://$S3_BUCKET_NAME/$BACKUP_FILENAME.gpg s3://$S3_BUCKET_NAME/$BACKUP_FILENAME_MONTHLY.gpg --storage-class DEEP_ARCHIVE || healthchck_fail "failed to create monthly backup" fi healthchck_ok "Success"