Rclone creating tens of thousands of empty directories

What is the problem you are having with rclone?

I have a huge tree with many tens of thousands of files spread over a few tens of thousands of directories. I want to copy/sync certain files (hundreds) from local to two remotes (one is an S3, the other a pcloud). The files to copy are all of the form "*Data.rar" with the * part a short string of [a-z0-9], ie "fwdsData.rar". These files are spread all over the place.

When I test this with this command line:
rclone ls /local/path1 --include "*Data.rar"
I get a tidy listing of those files and this looks good. However, when I run
rclone copy/sync /local/path1 /local/path2 --include "*Data.rar"
I get a tree in /local/path2 with those hundreds of *Data.rar files in their respective locations but also with a few tens of thousands of empty directories (all those w/o a "*Data.rar" file). I know that I can probably remove those with the rmdirs command but it seems less than ideal to create all those empty directories in the first place. Caveat: I have not yet tried to copy those files to a "real" remote.

I've checked the various filter possibilities and found nothing to simply skip creating empty directories (filtering seems to work with files only?). There have been a few discussions here about empty directories but I haven't seen anything that would help with this.

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

1/ram/testrc>rclone version
rclone v1.66.0
- os/version: debian 12.5 (64 bit)
- os/kernel: 6.1.0-18-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.22.1
- go/linking: static
- go/tags: none

welcome to the forum,

this is a known bug/issue/feature that broke backwards compatibility, and will be fixed in the next release of rclone.
for now, there are at least three workarounds.

  1. use last stable, v1.65.2 - this is what i have chosen to do.
  2. try --no-update-dir-modtime
  3. try the beta

Thanks for the quick answer.

a known bug/issue/feature

TBH to me that feels more like a bug than a feature :-/ As to the remedies:

  1. This works.
  2. No change w/ 1.66.0, so not sure what it does.
  3. Haven't tried as 1.65.2 seems to be working.

Again thanks.

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