From 8eb340945bd29ff55089912e2ce96e614d490214 Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Thu, 16 Dec 2021 08:47:03 +0000 Subject: [PATCH] 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 --- bw-dev | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bw-dev b/bw-dev index cfe8747fb..0a06b5edb 100755 --- a/bw-dev +++ b/bw-dev @@ -146,7 +146,13 @@ case "$CMD" in awscommand "bookwyrm_media_volume:/images"\ "s3 cp /images s3://${AWS_STORAGE_BUCKET_NAME}/images\ --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) awscommand "$(pwd):/bw"\ @@ -184,6 +190,7 @@ case "$CMD" in echo " generate_thumbnails" echo " generate_preview_images [--all]" echo " copy_media_to_s3" + echo " sync_media_to_s3" echo " set_cors_to_s3 [cors file]" echo " runweb [command]" ;;