mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 21:33:28 +01:00
reacting to S3_HOST config envvar by setting the --endpoint-url parameter on AWS CLI
This commit is contained in:
@@ -420,7 +420,10 @@ move_backup() {
|
|||||||
export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
|
export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
|
||||||
export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
|
export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
|
||||||
export AWS_DEFAULT_REGION=ap-northeast-2
|
export AWS_DEFAULT_REGION=ap-northeast-2
|
||||||
aws s3 cp ${tmpdir}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target}
|
|
||||||
|
[[ ( -n "${S3_HOST}" ) ]] && PARAM_AWS_ENDPOINT_URL=" --endpoint-url ${S3_PROTOCOL}://${S3_HOST}"
|
||||||
|
|
||||||
|
aws ${PARAM_AWS_ENDPOINT_URL} s3 cp ${tmpdir}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target}
|
||||||
|
|
||||||
rm -rf ${tmpdir}/*.md5
|
rm -rf ${tmpdir}/*.md5
|
||||||
rm -rf ${tmpdir}/"${target}"
|
rm -rf ${tmpdir}/"${target}"
|
||||||
|
|||||||
Reference in New Issue
Block a user