In a bucket where you have access to some files only, is it possible to use a single cp command but skip all the files you do not have access to?
Ex if I run aws s3 cp s3://mybucket/ .
I will get an error saying access denied to some file, I'd like to skip these errors and continue downloading what I have access to.
To test your scenario, I did the following:
aws s3 cp --recursive s3://my-bucket/foo/ .
The result was:
download failed: s3://my-bucket/foo/f1 to ./f1 An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
download: s3://my-bucket/foo/f2 to ./f2
It successfully 'skipped-over' the object that it couldn't access. Therefore, the default behaviour should suit your needs.
I also tried it with:
aws s3 sync s3://my-bucket/foo/ .
It gave an error for the inaccessible file, but kept going. So this is also a viable option for you.
Summary: The AWS CLI cannot detect access permissions prior to attempting to copy an object, but it gracefully handles errors on individual objects.