Can rclone access and sync to 'Shared drives'?

GD

Hi, I have a question:

Can rclone access and sync to 'Shared drives'?

They don't appear on a normal drive and setting up a Team Drive doesn't give access to the 'Share' folder either.

–drive-shared-with-me gives access to 'Shared with me', but not to 'Shared drives > Share'.

Also tried by adding the unique 'root ID' of the 'Share' and of a folder created in the Share. Also doesn't work and throws api errors when trying to send a file to that folder.

So, can 'Share' be accessed using rclone?

You'd authenticate on the user that has access to the shared drive and use --drive-shared-with-me.

You haven't shared your config/version/any useful out to help troubleshoot though so not sure.

Currently setup as follows:

[drive]
type = drive
client_id = X
client_secret = X
scope = drive
token = X

[crypt]
type = crypt
remote = drive:/Archive
filename_encryption = standard
directory_name_encryption = true
password = X
password2 = X

Can you share the version you are using along with the command you are trying to run with debug (-vv) on it.

C:\rclone>rclone copy --drive-shared-with-me drive:/_test crypt:/_test -vv
2019/07/05 15:16:18 DEBUG : rclone: Version "v1.48.0" starting with parameters ["rclone" "copy" "--drive-shared-with-me" "drive:/_test" "crypt:/_test" "-vv"]
2019/07/05 15:16:18 DEBUG : Using config file from "C:\rclone\rclone.conf"
2019/07/05 15:16:18 DEBUG : drive: Loaded invalid token from config file - ignoring
2019/07/05 15:16:18 DEBUG : Keeping previous permissions for config file: -rw-rw-rw-
2019/07/05 15:16:18 DEBUG : drive: Saved new token in config file
2019/07/05 15:16:19 ERROR : : error reading source directory: directory not found

drive: Loaded invalid token from config file - ignoring

Not sure about that error - I can access the drive fine using ls or rclone browser and the directories do exist.

Also, rclone ls drive: --drive-shared-with-me returns the content of the root folder, not the 'Shared folder': 3512218 Getting started

Let's take a few steps back.

What does:

rclone lsd --drive-shared-with-me drive:

show

Oddly enough, nothing:

H:\rclone>rclone lsd --drive-shared-with-me drive:

H:\rclone>

Seems it isn't shared with the account you are using:

[felix@gemini ~]$ rclone lsd GD: --drive-shared-with-me
          -1 2019-07-05 10:34:31        -1 Share
          -1 2019-07-05 10:33:55        -1 Test

I am the admin of both accounts - emails are added and if I send a file to 'Share', it appears on both shares immediately, so definitely not a perms issue.

To clarify: are 'Shared with me' and 'Share' the same thing?

I'm not convinced they are the same. here's why:

GD2

H:\rclone>rclone lsd drive: --drive-shared-with-me
-1 2019-03-06 09:10:19 -1 random.txt

--drive-shared-with-me is listing only items that have been 'Shared with me' ... not items that are in the 'Share' folder.

Try getting the ID of the shared drive from the URL bar, then putting it in --drive-root-folder-id XXXX - that will show whether you can access it or not from rclone.

What are those shared drives? Are they teamdrives? If so you need to configure them in the rclone config phase.

rclone lsd drive: --drive-root-folder-id 8FbfYY6ghbeG7-XUkRPVA

Returns a blank field ... so I guess it's not possible to access the 'Shared' folder directly.

'Shared drives' is 'Team drives' renamed?

Just to be sure, I created a brand new Team Drive called 'Share', added the Client ID and Secret and authorised Google via rclone:

[Share]
type = drive
client_id = X
client_secret = X
scope = drive
token = X
team_drive = Share

H:\rclone>rclone lsd Share: --drive-shared-with-me
2019/07/05 16:22:22 ERROR : : error listing: couldn't list directory: googleapi: Error 404: Shared drive not found: Share, notFound
2019/07/05 16:22:22 Failed to lsd with 2 errors: last error was: couldn't list directory: googleapi: Error 404: Shared drive not found: Share, notFound

So does that confirm that a Shared drive / Team drive can't be accessed directly using rclone?

The --drive-shared-with-me flag is not necessary, and in fact will probably not work at all, for "Shared Drives" (aka Team Drives)

Also, the team_drive parameter should be the id of the drive visible in the UI when you click on the drive, not the name of the drive.

That's it darthShadow - thank you!

I couldn't see how/where to edit the team_drive parameter, so simply edited the rclone.conf to add the id of the drive ... and now it works:

C:\rclone>rclone lsd Share:
-1 2019-07-05 16:39:51 -1 testing

If using rclone to copy from gdrive1:Share > gdrive2:Share, is the copy done server-side or locally?

Oh yes Team drives are now Shared drives - that makes sense! So when you run through rclone config it should present a list of team drives for you to choose from.

image