How to update an S3 bucket with an expiration date using AWS CLI

I want to update the S3 bucket with new content (create a folder in the bucket). What is the date format --expires . I did not find any examples using AWS CLI in google. Can someone please help me with this?

Something like that:

 aws s3 sync $backup_home s3://backup/$app-backup/$app-$DATE --expires '$DATE' 
+7
amazon-s3 aws-cli
source share
1 answer

aws s3 sync expects the datetime string to be in GMT ISO 8601 format as the format for the -expires parameter. Something like that:

 aws s3 sync $backup_home s3://backup/$app-backup/$app-$DATE --expires '2016-06-14T00:00:00Z' 
+9
source share

All Articles