Skip to content

Set sync conditions with a sync-if enum #10016

Closed as not planned
Closed as not planned

Description

@RyanFitzSimmonsAK

Describe the feature

From #599 (comment),

What about adding a single, self-documenting --sync-if flag instead of the growing number of non self-documenting options? (e.g. --size-only, --exact-timestamps. Can I apply these two at the same time? Why do I have to read the documentation / try them to figure this out?).

The --sync-if could have a list of options:
--sync-if newer-timestamp,different-md5,different-timestamp,different-size,deleted,...

The user could specify one or more (comma separated list) and if the file meets any of the criterias, it will be updated (uploaded/deleted) at the destination.

This would clarify the behaviour greatly, especially if you'd mentioned in the documentation that the default behaviour is
--sync-if different-timestamp,different-size.

Use Case

After the first sync command (local->s3), the local files will have an mtime of 0, and the contents in s3 will have a LastModified time of 10 (using relative offsets). When we run the second aws s3 sync command, which is syncing from s3 to local we'll first do the file size check. In this case the file sizes are the same so we look at the last modified time checks. In this case they are different (local == 0, s3 == 10). If we were doing a strict equality comparison then, because the last modified times are different, we would unnecessarily sync the files from s3 to local. So we can say that if the file sizes are the same and the last modified time in s3 is greater (newer) than the local file, then we don't sync. This is the current behavior.

However, this creates a problem if the remote file is updated out of band (via the console or some other SDK) and the size remains the same. If we run aws s3 sync s3://bucket local/ we will not sync the remote file even though we're suppose to.

Activity

  1. changed the title [-](short issue description)[/-] [+]Set sync conditions with a sync-if enum[/+] on Jan 23, 2026
  2. added
    needs-reviewThis issue or pull request needs review from a core team member.
    p2This is a standard priority issue
    and removed
    needs-triageThis issue or PR still needs to be triaged.
    on Jan 27, 2026
  3. removed
    needs-reviewThis issue or pull request needs review from a core team member.
    on Feb 13, 2026
  4. RyanFitzSimmonsAK commented on Feb 13, 2026

    @RyanFitzSimmonsAK
    ContributorAuthor

    After review with the team, we've elected not to pursue this feature request.

  5. github-actions commented on Feb 13, 2026

    @github-actions
    Contributor

    This issue is now closed. Comments on closed issues are hard for our team to see.
    If you need more assistance, please open a new issue that references this one.

  6. github-actions commented on Feb 13, 2026

    @github-actions
    Contributor

    This issue is now closed. Comments on closed issues are hard for our team to see.
    If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p2This is a standard priority issues3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions