简体   繁体   中英

How do I move files whose name changes daily to AWS S3 bucket using AWS CLI?

I have script that runs daily and saves a CSV file with daily time stamp below is the AWS CLI command for moving a file to S3 bucket and then delete it from source I am using.

aws s3 mv /path/NW_test_Export_03_05_2020_14_37_24.csv s3://bucekt-name/folder/ --acl public-read-write

I want to automate this daily moving of file to S3 bucket using a Cron job. How do I make the file name variable in the AWS CLI command?

Ok by trial and error the below command is working perfectly for me.

aws s3 mv /path-to-file/ s3://bucekt-name/folder/ --exclude "*" --include "*.csv" --recursive

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM