Gdrive: sharing rules lead to duplicates in local sync

What is the problem you are having with rclone?

I am locally syncing gdrive folders shared with me.
In some of these, there are nested folders with different sharing rules, eg. there is A/B/C/, where

  • A/ is shared with we with reader permission
  • C/ is shared with we with editor permission

When syncing, rclone creates destDir/A/B/C/, and duplicates it to destDir/C/.
Moreover, excluding C/ using a "- C/**" filter results in both destDir/A/B/C/ and destDir/C/ being excluded; so it seems rclone is already able to identify them as same files.

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

- os/version: debian bookworm/sid (64 bit)
- os/kernel: 6.0.0-6-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.19.4
- go/linking: dynamic
- go/tags: none

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

Google Drive

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

rclone sync -P MyDrive: --drive-shared-with-me destDir/

The rclone config contents with secrets removed.

[MyDrive]
type = drive
scope = drive
token = {"access_token":… }

If you want a particular C excluded then you need to put a / at the start, so

--exclude "/C/**"

Or

- /C/**

Thanks, it works; I missed it in the documentation.
It's a good workaround, however the main issue remains: I would have to manually exclude every shared subfolder while rclone could be able to detect them.

Unfortunately because rclone supports so many providers it doesn't have a concept of a shared subdirectory.

Couldn't the gdrive backend present these as shortcuts, that could be ignored using --drive-skip-shortcuts ?

Or perhaps you could arrange a directory full of shortcuts with the view that you'd like to see? That would work.

Yes, but I would have to manually update it every time something is shared with me, with no easy way to monitor if something is missing.