Skip to content

Unexpected behaviour with sync --delete not deleting files removed from source #852

@nelli91

Description

@nelli91

Description

The s5cmd sync --delete command successfully syncs files from source to destination, but does not delete files from the destination that have been removed from the source directory. The command completes without errors, but the --delete flag appears to have no effect.

Command Used

s5cmd --log debug sync --delete --acl public-read --destination-region my-region ./dist "s3://bucket-name/"

Expected Behavior

When files are removed from the local ./dist directory, running s5cmd sync --delete should:

  1. Upload new/modified files from ./dist to s3://bucket-name/
  2. Delete files from s3://bucket-name/ that no longer exist in ./dist

Actual Behavior

  1. ✅ New and modified files are correctly uploaded to S3
  2. ❌ Files removed from ./dist are not deleted from the S3 bucket
  3. ✅ Command completes successfully (exit code 0)
  4. ✅ No error messages are logged
  5. ❌ Using the --log debug I see that files are being copy, using cp instead of sync (but probably is normal behaviour under the hood)

Environment

  • s5cmd version: 2.3.0
  • OS: Ubuntu (GitHub Actions ubuntu-latest)
  • Source: Local directory ./dist (contains static web assets)
  • Destination: S3 bucket s3://bucket-name/
  • Authentication: using the same aws-actions/configure-aws-credentials@v4

Comparison with AWS CLI

The equivalent aws s3 sync command works correctly:

aws s3 sync --delete ./dist "s3://bucket-name/"

Additional Context

  • The command is executed in a GitHub Actions workflow
  • No --exclude or --include patterns are specified

Request

I know about your aws-cli compatibility disclaimer, I'm looking for help to understand if I'm doing something wrong here or is an already known issue. About permissions, can it work differently from aws-cli?

Thankss! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions