Add sync_media_to_s3 command

This is useful if the copy gets aborted, or to sync over remnants
generated between the copy and the switchover to S3
This commit is contained in:
Joel Bradshaw 2021-12-16 08:47:03 +00:00 committed by Joel Bradshaw
parent f7c6cb3598
commit 8eb340945b

9
bw-dev
View file

@ -146,7 +146,13 @@ case "$CMD" in
awscommand "bookwyrm_media_volume:/images"\ awscommand "bookwyrm_media_volume:/images"\
"s3 cp /images s3://${AWS_STORAGE_BUCKET_NAME}/images\ "s3 cp /images s3://${AWS_STORAGE_BUCKET_NAME}/images\
--endpoint-url ${AWS_S3_ENDPOINT_URL}\ --endpoint-url ${AWS_S3_ENDPOINT_URL}\
--recursive --acl public-read" --recursive --acl public-read" "$@"
;;
sync_media_to_s3)
awscommand "bookwyrm_media_volume:/images"\
"s3 sync /images s3://${AWS_STORAGE_BUCKET_NAME}/images\
--endpoint-url ${AWS_S3_ENDPOINT_URL}\
--acl public-read" "$@"
;; ;;
set_cors_to_s3) set_cors_to_s3)
awscommand "$(pwd):/bw"\ awscommand "$(pwd):/bw"\
@ -184,6 +190,7 @@ case "$CMD" in
echo " generate_thumbnails" echo " generate_thumbnails"
echo " generate_preview_images [--all]" echo " generate_preview_images [--all]"
echo " copy_media_to_s3" echo " copy_media_to_s3"
echo " sync_media_to_s3"
echo " set_cors_to_s3 [cors file]" echo " set_cors_to_s3 [cors file]"
echo " runweb [command]" echo " runweb [command]"
;; ;;