Skip to content

s3 sync: Read include/exclude patterns from file #5160

@schw4rzlicht

Description

@schw4rzlicht

Problem

When using s3 sync, we can include/exclude objects for the sync using --exclude <pattern> and --include <pattern>. This can be cumbersome if someone has to deal with many patterns at once.

Proposed solution

I'd suggest to implement two additional options: --exclude-file <filename> and --include-file <filename> so we would be able to specify files which contain lists of patterns. See how rsync does it here. Implementing it in the same way as rsync does would have the benefit of maintaining one list for both.

Additional selling point: the exclude file can be managed in git without tampering with CI scripts.

Example usage

Now

aws s3 sync . s3://bucket/html/ --exclude=".*" --exclude "license/*" --exclude "LICENSE.md" --exclude "*.map" --exclude "*.scss" --exclude "customVariables.css" --exclude "css/bootstrap/*"

With proposed feature

aws s3 sync . s3://bucket/html/ --exclude-file .syncignore

Alternatives I have considered

None really. The only alternative I know of is using many single statements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p3This is a minor priority issues3filterss3sync

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions