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"