Skip to content

Copy the Entire Contents of a Directory, etc.

Timothy Kay edited this page Aug 22, 2013 · 1 revision

Short answer: There is no native support for operating on multiple files. However, there is a way to do some such operations.

Long answer: Amazon S3 operates on a single file at a time. There is no API support for operating on multiple files at once. The "aws" program was designed to give you easy command line access to the API. In a few places, it embellishes the API with program logic to make it much, much easier. A good example is Multi-Part Upload, which requires a sequence of API calls. The "aws" program handles the sequence of operations for you.

On the other hand, "aws" does not provide a convenient method for downloading or syncing an entire folder. It's not part of the S3 API, and it's not part of "aws".

There is a mechanism that can do such operations, the --exec="PERL SNIPPET" switch. On an "ls" command, you specify a Perl snippet that runs for each object in the list.

For examples of --exec, see http://timkay.com/aws/howto.html, #5 and #6