Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws s3 sync --exclude does not properly skip files/directories that are not readable #2767

Closed
ianslai opened this issue Aug 15, 2017 · 2 comments
Labels
duplicate This issue is a duplicate.

Comments

@ianslai
Copy link

ianslai commented Aug 15, 2017

I have a script that automates aws s3 sync of the contents of a disk, and I want to exclude the lost+found directory. However, the user the script runs at cannot read lost+found, which means when everything else is transferred properly, aws s3 sync ... --exclude 'lost+found' always fails with status 2. Ideally aws s3 sync should not even try to examine the directory and simply obey the pattern passed to --exclude.

Steps to reproduce:

mkdir /tmp/backup
touch /tmp/backup/foo
mkdir /tmp/backup/lost+found
chmod go-rx /tmp/backup/lost+found
sudo chown root:root /tmp/backup/lost+found
# Replace s3://mybucket/foo with a URL the current user has access to
aws s3 sync --dryrun /tmp/backup s3://mybucket/foo --exclude 'lost+found'

This generates the following output:

warning: Skipping file /tmp/backup/lost+found. File/Directory is not readable.
(dryrun) upload: ../backup/foo to s3://kyk-bi-backups/foo/foo 
$ echo $?
2

If you skip the sudo chown line, then this works properly and exits with status 0.

@joguSD
Copy link
Contributor

joguSD commented Aug 16, 2017

Very similar to #2473
Fix would be the same (apply excludes at the traversal level). I'm gonna close this issue in favor of the existing one.

@joguSD joguSD added the duplicate This issue is a duplicate. label Aug 16, 2017
@joguSD joguSD closed this as completed Aug 16, 2017
@ianslai
Copy link
Author

ianslai commented Aug 17, 2017

Thanks @joguSD! I didn't see the other issue when I did my search earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

2 participants