Skip to content

Commit

Permalink
verwrite configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Jan 24, 2024
1 parent 68703e0 commit 0e28c01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mirror-s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ if [[ "$MINIO_DEBUG" == "1" ]]; then
DEBUG="--debug"
fi

if [[ "$MINIO_OVERWRITE" == "1" ]]; then
echo "== OVERWRITE ENABLED =="
OVERWRITE="--overwrite"
fi

echo "Adding S3 source..."
/usr/bin/mc alias set s3_source ${SOURCE_ENDPOINT} ${SOURCE_ACCESS_KEY} ${SOURCE_SECRET_KEY}
Expand All @@ -14,4 +18,4 @@ echo "Adding S3 destination..."
/usr/bin/mc alias set s3_destination ${DESTINATION_ENDPOINT} ${DESTINATION_ACCESS_KEY} ${DESTINATION_SECRET_KEY}

echo "Start mirror..."
/usr/bin/mc ${DEBUG} mirror --overwrite ${MINIO_EXTRA_OPTS} s3_source/${SOURCE_BUCKET} s3_destination/${DESTINATION_BUCKET} && curl ${HEALTHCHECK_URL}
/usr/bin/mc ${DEBUG} mirror ${OVERWRITE} ${MINIO_EXTRA_OPTS} s3_source/${SOURCE_BUCKET} s3_destination/${DESTINATION_BUCKET} && curl ${HEALTHCHECK_URL}

0 comments on commit 0e28c01

Please sign in to comment.