--drive-shared-with-me and server side copy


I have tried sharing a folder, adding it to my drive and server side copying it to wherever I want in my drive and everything went smooth as butter, but I am struggling to understand how the --drive-shared-with-me flag will save me the “add to my drive” step.

According to the --drive-shared-with-me documents, the flag will “only show files that are shared with me”, which, as I understand it, means that when using it we are working with the “shared with me” folder as the root folder.

What I struggle to understand is how can I copy the shared folder to my drive when --drive-shared-with-me is preventing that particular instance of rclone from seeing my drive.

I am asking this because I tried (more or less) the following:

rclone copy --drive-shared-with-me mydrive:sharedfolder mydrive:path\sharedfolder

The command completed the server side copy correctly. I expected it to place “sharedfolder” inside mydrive:path, but what happened instead is that such command created another mydrive:path which contained just sharedfolder besides the already present mydrive:path (with all the stuff there).

I know that gdrive allows such duplicates and I am not shocked by that, but I would like rclone to place the shared folder in the path I told it to, and not to create a parallel duplicate path.

There must be a way to do that, but I can’t understand how to access the whole drive when using the --drive-shared-with-me flag.


I’m not quite following what you want to happen.

If you use the drive-shared-with-me, it only shows the files shared with you for the first part.

So in my case I have a folder shared call “Test”

I copied that folder to my GD in a new folder I named TestCopy.

[felix@gemini gmedia]$ rclone lsf --drive-shared-with-me GD:
[felix@gemini gmedia]$ rclone copy --drive-shared-with-me GD: GD:TestCopy

Can you provide what you are expecting to happen with real names and folders?

So in “copy --drive-shared-with-me remote:whatever remote:” the destination is the regular full-drive-access remote?

Then I don’t understand why rclone created a duplicate path.

What I intend is the following:

Say that I have a folder full of pics from different countries under remote:countries. Inside that there are the folders “canada” and “usa”.

In my shared folder I got a folder called “mexico”, which I want to copy to remote:countries along “canada” and “usa”.

If I do “copy --drive-shared-with-me remote:mexico remote:countries/mexico” I don’t get “mexico” under countries and along “canada” and “usa” but another “countries” folder with just “mexico” in it, so I end up with 2 “countries” folders, one with the stuff I had there and other with the stuff I’ve just copied.

BTW, I’m working with crypt remotes, if that’s relevant.

Here is what I ran.

[felix@gemini ~]$ rclone copy --drive-shared-with-me GD:Test GD:Countries/Test -vv
2019/04/21 10:26:18 DEBUG : rclone: Version "v1.47.0" starting with parameters ["rclone" "copy" "--drive-shared-with-me" "GD:Test" "GD:Countries/Test" "-vv"]
2019/04/21 10:26:18 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2019/04/21 10:26:19 INFO  : Google drive root 'Countries/Test': Waiting for checks to finish
2019/04/21 10:26:19 INFO  : Google drive root 'Countries/Test': Waiting for transfers to finish
2019/04/21 10:26:23 INFO  : (Public) U22.17.0.1 - Mastery Checklist by /u/Sekwah.xlsx: Copied (server side copy)
2019/04/21 10:26:23 INFO  :
Transferred:   	       off / off, -, 0 Bytes/s, ETA -
Errors:                 0
Checks:                 0 / 0, -
Transferred:            1 / 1, 100%
Elapsed time:        4.5s

2019/04/21 10:26:23 DEBUG : 7 go routines active
2019/04/21 10:26:23 DEBUG : rclone: Version "v1.47.0" finishing with parameters ["rclone" "copy" "--drive-shared-with-me" "GD:Test" "GD:Countries/Test" "-vv"]


[felix@gemini ~]$ rclone ls GD:Countries
       -1 Test/(Public) U22.17.0.1 - Mastery Checklist by /u/Sekwah.xlsx

If you want to share the run with -vv, we can see what’s going on.

This is still happening to me with 2 other totally different gdrive accounts.

I’ve just set up a suite account and I’m copying everything there. Every copy/sync command from a folder shared with me to gdrive:path will always duplicate “path” in gdrive:

It’s like rclone or drive doesn’t know that I already have “path” in my drive.

It’s very frustrating because I can’t resume uploads after the 750 GB daily cap. It just starts all over again from the beginning a creates a new “path” alongside the old one.

@Animosity22 Now that you have Countries/Test, share a new folder called “Test2” and try to copy it to Countries/Test2.

If you experience the same thing I’m experiencing, you’ll end up with this folder structure:

Instead of having “Test” and “Test2” under “Countries”.

And if you copy Test2 again after that, you’ll see 3 “Countries” folders, 1 of which with “Test” inside and the other 2 with “Test2” inside.

Yeah, that seems to be a bug as I can recreate that as well.

I’d open an issue on github for it and include the method to recreate the issue albeit, it’s simple to do as you just run twice.

Looking at drive docs in rclone, maybe --fast-list, which I’m using, has something to do with it.

Is there a chance? I’m under the 750 GB limit ATM and can’t test.

Thank for opening the issue.

I was not using fast list in my tests.

Weird. I’ve seen reports in reddit of rclone resuming a large folder where it left the day before.

Apparently this issue was already reported back in October 2018

To quote ncw himself:

The --drive-shared-with-me hides the non shared with me stuff so rclone doesn’t see the existing folder and creates a duplicate

Which BTW is what was puzzling me in the OP.

Until it is fixed, a workaround seems to be adding the shared folder to your drive and copy from there. This will avoid using the flag --drive-shared-with-me, which is what is causing the issue.

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