Bisync leaving empty directories on UNC path 1 or local filesystem path 2 on directory renames

What is the problem you are having with rclone?

My bisyncs seem to run successfully between my server and local filesystem. The only hiccup I have encountered is if I rename a directory even when using --track-renames, the path that didn't have the edited directory now has the new directory name (with the contents transferred in) but an empty directory under the old name.

For example:

Path 1 == UNC, it has a directory named Music but changed to ‘Audio’ on the server. If I run my bisync, the outcome is all content from Music on Path 2 is now put into an Audio folder but the ‘Music’ directory is left behind and not deleted. I have tried adding --remove-empty-dirs as an option, but I get ‘access is denied’ when trying to make those rmdir changes on the UNC path. Is there something I am missing in my setup?

P.S. First-time poster, long-time reader, I apologize for any formatting mistakes in my post. Please let me know if I need to improve my submission. Thank you!

Run the command 'rclone version' and share the full output of the command.

rclone v1.71.0

  • os/version: Microsoft Windows 10 Enterprise 22H2 22H2 (64 bit)
  • os/kernel: 10.0.19045.6216 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.25.0
  • go/linking: static
  • go/tags: cmount

Which cloud storage system are you using? Local Filesystem

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

 rclone bisync "remote:UNC Path" "remote:Local Path" --resync-mode newer --create-empty-src-dirs --compare size,modtime,checksum --download-hash --force --resilient --recover -MvP --fix-case --conflict-resolve newer --filters-file "filters.txt" --backup-dir "remote:backup path""   
Paste command here

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[redacted]
type = local

A log from the command that you were trying to run with the -vv flag

Paste  log here

Have you considered this:

Any empty directories after the sync on both the Path1 and Path2 filesystems are not deleted by default, unless --create-empty-src-dirs is specified. If the --remove-empty-dirs flag is specified, then both paths will have ALL empty directories purged as the last step in the process.

Try with --dry-run whether --remove-empty-dirs flag achieves what you want.

EDIT:

I see that you have already tried:

This came up once before, and at the time, we were not able to reliably reproduce it:

However, now I have a better idea of what the issue might be. (os: Remove/RemoveAll should remove read-only folders on Windows · Issue #26295 · golang/go · GitHub)

Would you be able to give this beta a try and see if it solves your issue?

v1.72.0-beta.9089.834c70b19.fix-windows-rmdir

Branch: GitHub - rclone/rclone at fix-windows-rmdir

If it does not fix it, it would be helpful if you could also run

rclone rmdir your_UNC_path -vv

and post the output here.

The beta build fixed it for me. Thank you!

1 Like

Thank you very much for testing and confirming.

I've opened a PR about this here:

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