简体   繁体   中英

Copy folder + append datetimestamp in S3 using aws cli

Does anyone know how to copy a whole folder to s3 and append date and timestamp to that folder?Example, when I run this command:

 aws s3 cp sourcefolder s3://somebucket-test-bucket/ --recursive

Then in my bucket I want to see "sourcefolder+datetimestamp" uploaded. That way my folder doesn't get overwritten as it has a unique name.

There is no way to do that using the CLI, unless you provide the timestamp as part of the parameters.

bash example: aws s3 cp sourcefolder s3://my-bucket/foldername+$(date +"%d-%m-%y")/

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