From aa81957586ea418d42b1d07cbec513e0ff9c2b20 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 6 Jun 2019 17:04:51 +0100 Subject: [PATCH] drive: add --drive-server-side-across-configs In #2728 and 55b9a4e we decided to allow server side operations between google drives with different configurations. This works in some cases (eg between teamdrives) but does not work in the general case, and this caused breakage in quite a number of people's workflows. This change makes the feature conditional on the --drive-server-side-across-configs flag which defaults to off. See: https://forum.rclone.org/t/gdrive-to-gdrive-error-404-file-not-found/9621/10 Fixes #3119 --- backend/drive/drive.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index 91781171c..63d71aa9b 100644 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -382,6 +382,16 @@ will download it anyway.`, Default: defaultBurst, Help: "Number of API calls to allow without sleeping.", Advanced: true, + }, { + Name: "server_side_across_configs", + Default: false, + Help: `Allow server side operations (eg copy) to work across different drive configs. + +This can be useful if you wish to do a server side copy between two +different Google drives. Note that this isn't enabled by default +because it isn't easy to tell if it will work beween any two +configurations.`, + Advanced: true, }}, }) @@ -427,6 +437,7 @@ type Options struct { V2DownloadMinSize fs.SizeSuffix `config:"v2_download_min_size"` PacerMinSleep fs.Duration `config:"pacer_min_sleep"` PacerBurst int `config:"pacer_burst"` + ServerSideAcrossConfigs bool `config:"server_side_across_configs"` } // Fs represents a remote drive server @@ -924,7 +935,7 @@ func NewFs(name, path string, m configmap.Mapper) (fs.Fs, error) { ReadMimeType: true, WriteMimeType: true, CanHaveEmptyDirectories: true, - ServerSideAcrossConfigs: true, + ServerSideAcrossConfigs: opt.ServerSideAcrossConfigs, }).Fill(f) // Create a new authorized Drive client.