rclone: Sync fails when a new file has the same name as an old directory

What is the problem you are having with rclone?

When using the sync command, it doesn’t delete (recursively) directories on the remote that have been replaced with a single file having the same name.

What is your rclone version (eg output from rclone -V)

rclone v1.40-DEV

  • os/arch: linux/arm
  • go version: go1.9.3

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Linux, ARMv7 (32 bits)

Which cloud storage system are you using? (eg Google Drive)

Swift

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone --config ./rclone.conf sync --log-file sync-delete-ignore-err.log --ignore-errors --backup-dir remote:deleted/ my-local-dir remote:/remote-dir

It even retries on error, but always fails with the same error.

I see that there is a FIXME in the code, but I didn’t find an issue for this exact problem: https://github.com/ncw/rclone/blob/80588a5a6bea6efaf37bdad4598c735f9975d221/fs/sync/sync.go#L724

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Reactions: 3
  • Comments: 15 (7 by maintainers)

Most upvoted comments

I get this error from time to time and the solution is always to just delete the directory so that the next sync will work. IMO the behavior should be just that. I use this as a remote backup of my local backup and I want an exactly duplicate made. One could say I want a remote clone 😉.

My vote is to have it remove the directory and everything in it and put the new file in its place.