Miss_Orchid
Miss_Orchid

Reputation: 374

tar folder in s3 bucket?

Let's say I have a folder on s3:

s3://tmp/folder1

With several folders within. I would like this to now be:

s3://tmp/folder1.tar.gz

in which the contents of folder1 have been tar.gz'd. However, from what I can find, the only way to do this would be to:

  1. Either download folder1 to a local directory or cp/mv to an existing ec2 instance,
  2. run tar czv folder1.tar.gz folder1
  3. Reupload to s3://tmp

Is there a way to do this without having to move/download folder1? In other words, is there an amazon cli command / set of commands to do this without the download / moving?

Upvotes: 1

Views: 1265

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269480

No.

Amazon S3 does not provide the ability to manipulate the contents of objects.

You would need to copy the data somewhere, run the tar command, then upload it.

Think of it like asking a Hard Disk to tar/zip a file without a computer attached. It doesn't know how to do that.

Upvotes: 5

Related Questions