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:
nielash
(Niel)
September 6, 2025, 9:20am
3
This came up once before, and at the time, we were not able to reliably reproduce it:
opened 01:33AM - 07 Feb 25 UTC
closed 12:47AM - 25 Feb 25 UTC
bug
can't reproduce
good first issue
help wanted
OS: Windows
bisync
#### The associated forum post URL from `https://forum.rclone.org`
```
None
```
…
#### What is the problem you are having with rclone?
```
bisync "--remove-empty-dirs" can not delete empty folders on Windows 11, shows "Access is denied".
Run CMD or PowerShell with administrator privileges doesn't work.
Works fine on Linux and S3 Bucket.
```
#### What is your rclone version (output from `rclone version`)
```
rclone v1.69.0
- os/version: Microsoft Windows 11 IoT Enterprise LTSC 2024 24H2 24H2 (64 bit)
- os/kernel: 10.0.26100.3037 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.23.4
- go/linking: static
- go/tags: cmount
```
#### Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
```
Windows 11, 64 bit
```
#### Which cloud storage system are you using? (e.g. Google Drive)
```
S3 Compatible
```
#### The command you were trying to run (e.g. `rclone copy /tmp remote:tmp`)
```
rclone bisync remote:tmp C:/tmp --remove-empty-dirs -v
```
#### A log from the command with the `-vv` flag (e.g. output from `rclone -vv copy /tmp remote:tmp`)
```
2025/02/07 09:27:03 INFO : Removing empty directories
2025/02/07 09:27:04 DEBUG : removing 1 level 4 directories
2025/02/07 09:27:04 INFO : (My empty dir): Removing directory
2025/02/07 09:27:04 ERROR : (My empty dir): Failed to rmdir: remove \\?\C:\(My empty dir): Access is denied.
2025/02/07 09:27:04 DEBUG : removing 1 level 3 directories
2025/02/07 09:27:04 INFO : (My empty dir): Removing directory
2025/02/07 09:27:04 ERROR : (My empty dir): Failed to rmdir: remove \\?\C:\(My empty dir): Access is denied.
2025/02/07 09:27:04 DEBUG : Lock file removed: (hide)
2025/02/07 09:27:04 ERROR : Bisync critical error: failed to remove directories: 2 errors: last error: remove \\?\C:\(My empty dir): Access is denied.
2025/02/07 09:27:04 ERROR : Bisync aborted. Must run --resync to recover.
```
#### How to use GitHub
* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are affected by the same issue.
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
* Subscribe to receive notifications on status change and new comments.
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
nielash
(Niel)
September 9, 2025, 8:41am
5
Thank you very much for testing and confirming.
I've opened a PR about this here:
master ← fix-windows-rmdir
opened 06:13AM - 09 Sep 25 UTC
#### What is the purpose of this change?
Before this change, Rmdir (and other… commands that rely on Rmdir) would fail with "Access is denied" on Windows, if the directory had FILE_ATTRIBUTE_READONLY. This could happen if, for example, an empty folder had a custom icon added via Windows Explorer's interface (Properties => Customize => Change Icon...).
However, Microsoft docs indicate that "This attribute is not honored on directories."
https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants#file_attribute_readonly
Accordingly, this created an odd situation where such directories were removable (by their owner) via File Explorer and the rd command, but not via rclone.
An upstream issue has been open since 2018, but has not yet resulted in a fix. https://github.com/golang/go/issues/26295
This change gets around the issue by doing os.Chmod on the dir and then retrying os.Remove. If the dir is not empty, this will still fail with "The directory is not empty."
A bisync user confirmed that it fixed their issue in https://forum.rclone.org/t/bisync-leaving-empty-directories-on-unc-path-1-or-local-filesystem-path-2-on-directory-renames/52456/4?u=nielash
It is likely also a fix for #8019, although @ncw is correct that Purge would be a more efficient solution in that particular scenario.
#### Was the change discussed in an issue or in the forum before?
- #8363
- #8019
- https://forum.rclone.org/t/bisync-leaving-empty-directories-on-unc-path-1-or-local-filesystem-path-2-on-directory-renames/52456/4?u=nielash
#### Checklist
- [x] I have read the [contribution guidelines](https://github.com/rclone/rclone/blob/master/CONTRIBUTING.md#submitting-a-new-feature-or-bug-fix).
- [x] I have added tests for all changes in this PR if appropriate.
- [x] I have added documentation for the changes if appropriate.
- [x] All commit messages are in [house style](https://github.com/rclone/rclone/blob/master/CONTRIBUTING.md#commit-messages).
- [x] I'm done, this Pull Request is ready for review :-)
system
(system)
Closed
October 9, 2025, 8:42am
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.