Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update S3 bucket with expire date using AWS CLI

I would like to update the S3 bucket with the new content(create a folder within a bucket). What is the --expires date format. I didn't find any examples using AWS CLI on google. Can someone please help me on this thing?

Something like this:

aws s3 sync $backup_home s3://backup/$app-backup/$app-$DATE --expires '$DATE'
like image 687
user6136315 Avatar asked Jun 14 '16 21:06

user6136315


1 Answers

aws s3 sync expects a GMT ISO 8601 datetime string as the format for the -expires option. Something like this:

aws s3 sync $backup_home s3://backup/$app-backup/$app-$DATE --expires '2016-06-14T00:00:00Z'
like image 63
Anthony Neace Avatar answered Oct 10 '22 07:10

Anthony Neace