-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
s3 sync does not delete excluded files #4923
Comments
I think we should treat this as a feature request but make some adjustments to avoid breaking changes. In my opinion, the current documentation is valid, if somewhat confusing. It specifies that the exclude operation operates at the command level, so one could reasonably argue that flags such as delete shouldn't apply to excluded files.
I think a good alternative might be to add a --delete-excluded flag that meets your use case. Thoughts? Without an additional option, I don't think we can make the change without breaking others.
|
Given the close parallel to rsync, |
We have a slightly similar problem. Our command looks like this: |
hi,
|
I agree with the need for a new explicit option. We rely on the not-deleting version of |
Bumping the issue, the impact of |
the
--delete
flag on the s3 sync command does exactly what it says in the manual:Meaning that it will not delete files in the destination if they exist in the source even if they were excluded. To reproduce:
aws s3 mb s3://sync-delete-exclude mkdir /tmp/sync-delete-exclude touch /tmp/sync-delete-exclude/{1,2,3} aws s3 sync /tmp/sync-delete-exclude/ s3://sync-delete-exclude # we expect this to delete the file 3 aws s3 sync s3://sync-delete-exclude --exclude=3 --delete
Our use case is to sync only the last week/month/year of files out of a s3 bucket using exclude and include filters, but files that are excluded are not deleted, meaning we must invoke another step afterwards to delete excluded files. This seems far off from the intent of the command which is "make the destination look like the source after filtering"
The text was updated successfully, but these errors were encountered: