Rclone sync: do not create excluded and empty folders on Google Drive

rclone sync seems to be needlessly creating empty and excluded folders. The expected behavior is not clearly documented, but I suspect this is a bug. I cannot see any reason why rclone should be creating these folders.

I’m using the command rclone sync . GDrive:/docBackups -vv -u --ignore-case --filter "+ *.doc*" --filter "- *" --filter "- */" to recursively copy all MS Word documents to Google Drive. The command successfully copies all of the MS Word documents, but it also creates folders that are empty or that only contain files other than MS Word documents.

It seems to me that rclone sync should only create folder paths for actual files to be synced to the destination, especially since I am trying to otherwise exclude directories using --filter "- */". Is there some other way to accomplish the goal of not creating empty folders?

I’ve also tested this when syncing from Google Drive to my local machine (Windows), and the same behavior occurs. I have not tested with other cloud storage providers.

Yes this is rclone creating empty directories…

There is already an issue about this: https://github.com/ncw/rclone/issues/2869

move, copy and sync have the same problem.

Your comments on that issue would be appreciated - thanks.

Thanks… added a comment. Rclone definitely needs a flag that can control whether empty folders should or should not be created.