rclone / rclone/rclone

Files and Folder conflicts

Open
#6,264 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
59.8k
Forks
5.4k
Avg merge
2d 14h
Merged PRs (30d)
48

Description

Hi.

I am using rclone to keep a local server in sync with a remote server, but I ran into an issue a few days ago. I made some changes to a directory, where I split a file that had grown in size, into multiple files. These files were added to a directory with the same name as the original file that they derived from. This caused a conflict in my rclone sync, as it refused to replace the remote file with my new local directory. I took this into the forum for help.

Here are the highlights from that:

Rclone can't and won't overwrite a directory with a file - that could lead to data loss.

My take on this is:

On purpose or not, I do still see this as a bug.

What I am trying to run is not copy but sync. As the docs itself states:

Sync (one way) mode to make a directory identical

A one way mode to make a directory identical. In such a mode everything in the target location should be completely discarded, unless it already matches the source. When using the sync command, you implicitly tell rclone that you do not care about the target. All that you want, is to have it match the source.

And there is no safety in this behavior. Many files does not per definition mean important files. A single file can easily be magnitudes more important than a directory with multiple files. Yet is has no problem deleting a single file that does not exist in the source.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rclone's sync documentation and the linked forum discussion to understand the current file-versus-directory behavior and its safety rationale. Define the expected behavior for a source file replacing a destination directory, including how data loss is handled, then identify the relevant sync tests or add coverage once the behavior is agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.