rclone: Google Drive - Server Side Copy Duplicates Folder with --drive-shared-with-me

What is the problem you are having with rclone?

If you run a server side copy twice, you get two of the same folders and it repeats.

What is your rclone version (output from rclone version)

rclone v1.47.0

  • os/arch: linux/amd64
  • go version: go1.12.4

Which OS you are using and how many bits (eg Windows 7, 64 bit)

ArchLinux

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 copy --drive-shared-with-me GD:Test GD:Countries/Test -vv

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

rclone copy --drive-shared-with-me GD:Test GD:Countries/Test -vv
2019/04/24 18:59:10 DEBUG : rclone: Version "v1.47.0" starting with parameters ["rclone" "copy" "--drive-shared-with-me" "GD:Test" "GD:Countries/Test" "-vv"]
2019/04/24 18:59:10 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2019/04/24 18:59:11 INFO  : Google drive root 'Countries/Test': Waiting for checks to finish
2019/04/24 18:59:11 INFO  : Google drive root 'Countries/Test': Waiting for transfers to finish
2019/04/24 18:59:17 INFO  : (Public) U22.17.0.1 - Mastery Checklist by /u/Sekwah.xlsx: Copied (server side copy)
2019/04/24 18:59:17 INFO  : TestSheet.xlsx: Copied (server side copy)
2019/04/24 18:59:17 INFO  : Test2.xlsx: Copied (server side copy)
2019/04/24 18:59:17 INFO  :
Transferred:   	       off / off, -, 0 Bytes/s, ETA -
Errors:                 0
Checks:                 0 / 0, -
Transferred:            3 / 3, 100%
Elapsed time:        7.7s

2019/04/24 18:59:17 DEBUG : 8 go routines active
2019/04/24 18:59:17 DEBUG : rclone: Version "v1.47.0" finishing with parameters ["rclone" "copy" "--drive-shared-with-me" "GD:Test" "GD:Countries/Test" "-vv"]
[felix@gemini scripts]$ rclone copy --drive-shared-with-me GD:Test GD:Countries/Test -vv
2019/04/24 18:59:23 DEBUG : rclone: Version "v1.47.0" starting with parameters ["rclone" "copy" "--drive-shared-with-me" "GD:Test" "GD:Countries/Test" "-vv"]
2019/04/24 18:59:23 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2019/04/24 18:59:24 INFO  : Google drive root 'Countries/Test': Waiting for checks to finish
2019/04/24 18:59:24 INFO  : Google drive root 'Countries/Test': Waiting for transfers to finish
2019/04/24 18:59:28 INFO  : Test2.xlsx: Copied (server side copy)
2019/04/24 18:59:29 INFO  : (Public) U22.17.0.1 - Mastery Checklist by /u/Sekwah.xlsx: Copied (server side copy)
2019/04/24 18:59:29 INFO  : TestSheet.xlsx: Copied (server side copy)
2019/04/24 18:59:29 INFO  :
Transferred:   	       off / off, -, 0 Bytes/s, ETA -
Errors:                 0
Checks:                 0 / 0, -
Transferred:            3 / 3, 100%
Elapsed time:        6.3s

2019/04/24 18:59:29 DEBUG : 8 go routines active
2019/04/24 18:59:29 DEBUG : rclone: Version "v1.47.0" finishing with parameters ["rclone" "copy" "--drive-shared-with-me" "GD:Test" "GD:Countries/Test" "-vv"]

image

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (8 by maintainers)

Most upvoted comments

This problem is now fixed with the new connection string syntax added to v1.55

rclone copy GD,shared_with_me:Test GD:Countries/Test -vv

This means is is possible to add the shared_with_me to just the source on the command line.

I will hence close this issue!

Ran into the same problem today. Initially I wanted to use --drive-root-folder-id instead of --drive-shared-with-me but that threw a bunch of errors. Presumably also because it applies to both, dest and source.

Modifying the syntax would be my preferred solution, since that would be a fix for both flags.

Thank you for that workaround, ncw. It will solve my immediate problem for now. I shall test as soon as the dedupe finishes.

Edit: Sure enough, adding root_folder_id to the config file section of the source remote works.

rclone copy --drive-shared-with-me GD:Test GD:Countries/Test -vv

The reason this creates a duplicate is

  • the --drive-shared-with-me flag applies to both the source and the destination google drive
  • when rclone creates the directory in the dest, it can’t see it the next time you run the copy as it is using --drive-shared-with-me in the dest so it creates another

This suggests a work-around, create another remote with the shared_with_me = true in it. then do rclone copy drivesharedwithme: drive:. I’ve tested that and it works.

Another solution would be to allow all files to be visible in --drive-shared-with-me not just the shared files. That would work but would be quite a big change.

A final idea I has was to modify the remote syntax so you could do this which would set the --drive-shared-with-me flag a bit more precisely.

rclone copy drive,shared_with_me=true: drive: