Sync not deleting empty directories with ACD?

I’m not sure if this is a bug (in which case I’ll create an issue) or I’m just confused (or maybe it’s been fixed…)

Basically, empty directories don’t appear to get deleted by sync. They don’t show under ls but the do show with mount.

$ mkdir /tmp/foo
$ cd /tmp/foo
$ mkdir dir1 dir2 dir3
$ touch dir1/file1 dir2/file2 dir3/file3
$ rclone sync . Amazon:foo 
$ rclone ls Amazon:foo
        0 dir1/file1
        0 dir2/file2
        0 dir3/file3

So far, so good. My directory tree has been copied. Now let’s delete a directory and sync it.

$ rm -rf dir3
$ rclone sync . Amazon:foo
$ rclone ls Amazon:foo    
        0 dir1/file1
        0 dir2/file2

That looks good; what we’d expect.

But…

$ sudo rclone mount Amazon:foo /mnt &
[1]     3544
$ sudo ls /mnt
dir1  dir2  dir3

So dir3 still exists. And it’s empty, so can be deleted:

$ sudo rmdir /mnt/dir3
$ sudo ls /mnt        
dir1  dir2
$ rclone version
rclone v1.36-DEV

Which version of rclone are you using? If you are using 1.38 or the latest beta then I’d expect this to be working.

Ah yes, it seems to be fixed in 1.38.

Thanks!

1 Like