Problems with sync and directory moved to symlink

What is the problem you are having with rclone?

During my test to understand rclone, I've got the folowing problem when syncing a folder.

First sync is OK, but if a remove a directory, the replace it by a symlink, rclone fails to replicate the contents on the dest side.
Is there a flag / option about this particular case?

regards

What is your rclone version (output from rclone version)

rclone v1.54.1

  • go version: go1.15.8

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

  • os/arch: linux/amd64

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

tested on local to local

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

# cleanup, just in case
rm -rf /tmp/test /tmp/dest

mkdir -p /tmp/test/foo /tmp/test/foo2
echo "hello" > /tmp/test/foo/bar
echo "world" > /tmp/test/foo2/bar

echo "----- FIRST SYNC"
rclone sync --links /tmp/test /tmp/dest

rm -rf /tmp/test/foo
ln -s /tmp/test/foo2 /tmp/test/foo

echo "----- SECOND SYNC"
rclone sync --links -vv /tmp/test /tmp/dest

echo "----- SRC"
ls -l /tmp/test
echo "----- DEST"
ls -l /tmp/dest

The rclone config contents with secrets removed.

I don't think config is usefull as it is a local to local test

A log from the command with the -vv flag

Here is the output of my test script pasted before, second pass uses -vv flag

----- FIRST SYNC
----- SECOND SYNC
2021/03/22 12:02:59 DEBUG : rclone: Version "v1.54.1" starting with parameters ["rclone" "sync" "--links" "-vv" "/tmp/test" "/tmp/dest"]
2021/03/22 12:02:59 DEBUG : Creating backend with remote "/tmp/test"
2021/03/22 12:02:59 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2021/03/22 12:02:59 DEBUG : Creating backend with remote "/tmp/dest"
2021/03/22 12:02:59 ERROR : foo.rclonelink: Failed to remove previous file: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 ERROR : foo.rclonelink: Failed to copy: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 DEBUG : Local file system at /tmp/dest: Waiting for checks to finish
2021/03/22 12:02:59 DEBUG : foo2/bar: Size and modification time the same (differ by 0s, within tolerance 1ns)
2021/03/22 12:02:59 DEBUG : foo2/bar: Unchanged skipping
2021/03/22 12:02:59 DEBUG : Local file system at /tmp/dest: Waiting for transfers to finish
2021/03/22 12:02:59 ERROR : Local file system at /tmp/dest: not deleting files as there were IO errors
2021/03/22 12:02:59 ERROR : Local file system at /tmp/dest: not deleting directories as there were IO errors
2021/03/22 12:02:59 ERROR : Attempt 1/3 failed with 1 errors and: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 ERROR : foo.rclonelink: Failed to remove previous file: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 ERROR : foo.rclonelink: Failed to copy: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 DEBUG : Local file system at /tmp/dest: Waiting for checks to finish
2021/03/22 12:02:59 DEBUG : foo2/bar: Size and modification time the same (differ by 0s, within tolerance 1ns)
2021/03/22 12:02:59 DEBUG : foo2/bar: Unchanged skipping
2021/03/22 12:02:59 DEBUG : Local file system at /tmp/dest: Waiting for transfers to finish
2021/03/22 12:02:59 ERROR : Local file system at /tmp/dest: not deleting files as there were IO errors
2021/03/22 12:02:59 ERROR : Local file system at /tmp/dest: not deleting directories as there were IO errors
2021/03/22 12:02:59 ERROR : Attempt 2/3 failed with 1 errors and: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 ERROR : foo.rclonelink: Failed to remove previous file: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 ERROR : foo.rclonelink: Failed to copy: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 DEBUG : Local file system at /tmp/dest: Waiting for checks to finish
2021/03/22 12:02:59 DEBUG : foo2/bar: Size and modification time the same (differ by 0s, within tolerance 1ns)
2021/03/22 12:02:59 DEBUG : foo2/bar: Unchanged skipping
2021/03/22 12:02:59 DEBUG : Local file system at /tmp/dest: Waiting for transfers to finish
2021/03/22 12:02:59 ERROR : Local file system at /tmp/dest: not deleting files as there were IO errors
2021/03/22 12:02:59 ERROR : Local file system at /tmp/dest: not deleting directories as there were IO errors
2021/03/22 12:02:59 ERROR : Attempt 3/3 failed with 1 errors and: remove /tmp/dest/foo: directory not empty
2021/03/22 12:02:59 INFO  :
Transferred:   	        42 / 42 Bytes, 100%, 31.936 kBytes/s, ETA 0s
Errors:                 1 (retrying may help)
Checks:                 3 / 3, 100%
Elapsed time:         0.0s

2021/03/22 12:02:59 DEBUG : 2 go routines active
2021/03/22 12:02:59 Failed to sync: remove /tmp/dest/foo: directory not empty
----- SRC
total 4
lrwxrwxrwx 1 root root   14 Mar 22 12:02 foo -> /tmp/test/foo2
drwxr-xr-x 2 root root 4096 Mar 22 12:02 foo2
----- DEST
total 8
drwxr-xr-x 2 root root 4096 Mar 22 12:02 foo
drwxr-xr-x 2 root root 4096 Mar 22 12:02 foo2

This is a known issue I think - rclone cowardly refuses to delete a directory with an unknown amount of data in to write your symlink in its place.

You'll have to move the directory out of the way manually.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.