1

I am using s3smd package in ubuntu for uploading files on aws. Now i want to add lifecycle rule for different objects inside bucket. I can see the commands from http://s3tools.org/usage

According to s3cmd git page(https://github.com/s3tools/s3cmd/pull/295) I am using like this

s3cmd put --recursive  ${TMP_PATH}${FILENAME}${DATESTAMP}.tar.gz s3://${S3BUCKET}/${S3PATH}day/
s3cmd expire s3://${S3BUCKET} --expiry-days=365 --expiry-prefix=log/

but keep getting error

Usage: s3cmd [options] COMMAND [parameters]

s3cmd: error: no such option: --expiry-days

i am unable to find working example for how to add expiry date/lifecycle rule for a object in bucket. Let me know what i am doing wrong Thank you

NeiL
  • 791
  • 8
  • 35

1 Answers1

1

I realise this is an old question, but it appears on google, so worth answering.

Ubuntu (14.04) ships with an old version of s3cmd. You can check this by running

s3cmd --version 

The best thing to do is to install it with pip, the python package manager.

sudo apt-get remove s3cmd && sudo apt-get install python-pip && pip install s3cmd

You may need to log out, then back in to allow your path to s3cmd to update. But after that if you

s3cmd --version

You should get a much later version. Your expire flag should now work fine.

Cris Ward
  • 141
  • 1
  • 4