Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to retrive a single csv file from S3 bucket.
example: I have S3 -> project(folder) -> (contains 11 csv files) -> I want to reterive only one csv (customer) from project folder, That needed csv file's name comes with a combination of (randomnumber-timestamp-transactionid-customer.csv) so this cannot given as default one.
ts3connection->ts3list(here i want to filter file name with recent timestamp "3eca-20161011-164913-Customer.csv" customer file)->ts3get()
Thanks
VK
#!/bin/bash
FILENAME=$(aws s3 ls s3://_BUCKET_/_FOLDER_/ --recursive | sort | tail -n 1 | awk '{print $4}')
SOURCE='s3://_BUCKET_/'$FILENAME
TARGET=‘DESTINATION'
aws s3 cp $SOURCE $TARGET