1. AWS CLI Installation:
Install the AWS CLI following the instructions from the official AWS documentation
2. Configure your AWS CLI with your user credentials.
3. Once done with the installation try listing all objects in the S3 Bucket (goal here is just to get the file names)
aws s3 ls prod-user-media/goonj/ | awk '{print $4}' > image_url_in_s3.csv
4. Retrieve image file names from the media table and save the results to a CSV file / any_format_you_like.
SELECT REPLACE(image_url, 'https://s3.ap-south-1.amazonaws.com/prod-user-media/goonj/', '') as image_url_in_media_table FROM goonj.media ORDER BY REPLACE(image_url, 'https://s3.ap-south-1.amazonaws.com/prod-user-media/goonj/', '');
6. Compare the above two files and find the missing image file names.