[SOLVED] Why does sync leave the empty folders?

Hey Guys,

First of all, thanks for this product I use it for remote backups and it works well, I like it!
I'm just curious though, why is sync leaving all the empty directories after files were removed out of them?
Shouldn't sync just keep them fully in sync?
Running rclone rmdirs --leave-root just feel strange after using sync.
Anything I can tweak or technical limitation?

Thanks for any efforts taking to answer!

What is your rclone version (output from rclone version)

rclone v1.50.2

  • os/arch: linux/amd64
  • go version: go1.13.4

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

On unRaid 6.7 (Slackware build)

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

Webdav crypted remote

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

rclone sync

rclone move has


But im not sure if that work with sync..

1 Like

Thanks for the reply!

I did notice that one indeed, but I guess it just doesn't move/create empty folders?
I just would expect sync to do it by design, but wasn't able to track any information about why it's not behaving in that way.


rclone sync should delete empty directories on the destination and it does for me...

Can you give an example of it not deleting empty dirs?

$ tree src/

0 directories, 0 files
$ tree dst/
ā””ā”€ā”€ empty

1 directory, 0 files
$ rclone sync -vv src/ dst/
2019/11/27 21:16:52 DEBUG : rclone: Version "v1.50.2-071-g11b5ba92-fix-sharedrive-beta" starting with parameters ["rclone" "sync" "-vv" "src/" "dst/"]
2019/11/27 21:16:52 DEBUG : Using config file from "/home/ncw/.rclone.conf"
2019/11/27 21:16:52 INFO  : Local file system at /tmp/test/dst: Waiting for checks to finish
2019/11/27 21:16:52 INFO  : Local file system at /tmp/test/dst: Waiting for transfers to finish
2019/11/27 21:16:52 INFO  : Waiting for deletions to finish
2019/11/27 21:16:52 DEBUG : empty: Removing directory
2019/11/27 21:16:52 DEBUG : Local file system at /tmp/test/dst: deleted 1 directories
2019/11/27 21:16:52 INFO  : 
Transferred:   	         0 / 0 Bytes, -, 0 Bytes/s, ETA -
Elapsed time:          0s

2019/11/27 21:16:52 DEBUG : 4 go routines active
2019/11/27 21:16:52 DEBUG : rclone: Version "v1.50.2-071-g11b5ba92-fix-sharedrive-beta" finishing with parameters ["rclone" "sync" "-vv" "src/" "dst/"]
$ tree dst/

0 directories, 0 files
1 Like

Well, that's good to know!

I my specific case it's tripping over @eaDir directories.
I migrated away from Synology and used the commandline to migrate stuff over.
Initially I started off the cloud sync with all directories and hidden files in them, then I used some find commands locally to find and move all @eaDir's with their content to a new folder (before I deleted them).

Then I kicked off the sync and while some where removed, not all of them were.
I did a directory listing to a file locally (cause it takes quite some time to just list them) and after grepping on @eaDir it seems there are still 381 present. I guess the number was higher but I'm not 100% sure.

I will kick of the sync again tomorrow morning with the -vv switch, to see what the logs says about them.

Thanks for the quick responses, I appreciate it!

1 Like

Hi all,

I've did some additional tests, which included the -vv switch.
I noticed 163 @eaDirs getting removed during the last sync.
Though I'm very certain it were a lot more, I have the feeling every sync I did removed a bunch (a limit I've hit?)

Now I still noticed differences between cloud vs local (I want this to be 100% the same), bit this turned out to be the fact that sync is skipping empty directories.
With the --create-empty-src-dirs switch added I'm now seeing an identical number count which is perfect:
~~cat rclonelistingcloud2811.log | wc -l
~~cat rclonelistinglocal2811.log | wc -l

Thanks again for the help provided!
I will keep monitoring the forums to see progress getting made (for example checking hashes on crypted remotes).


Great - glad you got it sorted. Rclone's handling of empty directories is a little eccentric due to the fact it works on systems like s3 which can't have empty directories...

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