Jamo
Jamo

Reputation: 504

How can I get the downloaded files using sync in s3?

I am downloading files from a certain bucket using something like this:

aws s3 sync s3://my-bucket --profile xyz c:\Destination --exclude "*" --include ".txt"

Then I need to import data from those files, however I need to import those that where downloaded recently otherwise I might be importing data more than once.

Is there any instruction/option that returns that list of files?

Upvotes: 0

Views: 116

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269282

Not quite.

If you are doing an incremental sync and you only want to perform operations on the "newly downloaded" files, here are some options:

  • Keep a "before" list of the file and compare
  • You might be able to use the creation time of the files to make a comparison
  • Take the output of the command and turn it into useful information

Sample output is:

upload: test.txt to s3://mybucket/test.txt
upload: test2.txt to s3://mybucket/test2.txt

Upvotes: 1

Related Questions