Amazon S3: Use aws s3 cp without downloading existing files?

Viewed 3136

Is there a way using the AWS CLI to download files using --recursive and --exclude + --include and no overwrite files I have already downloaded? It likes to just rewrite files even if they haven't changed, and won't resume downloads after a crash.

2 Answers

Something like this will work:

aws s3 sync s3://bucket/path/to/folder/ . --exclude '*' --include 'filesToMatch*.txt'

As said by hjpotter92, --recursive is implied vs. cp.

And you can always include the --dryrun flag to verify what will run before actually executing it.

Related