Upload folder to shared google drive folder using service account

I need to upload the contents of a local directory into a folder on my google drive account. I need to use a service account to do this (as I do not have physical access to the machine that contains the local directory). The drive folder is shared with the service account email and I have verified that the service account can access the folder (I used the tool gdrive but I stopped using it as it had too many issues). I have tried the commands below where the random string is the drive folder identifier, and then "drivefoldername" is the actual name of the drive folder. I also tried using the --drive-impersonate command with both the service account email and the email of drive folder owner. I have no idea what else to do.


rclone copy --update --verbose images/ ImagesUpload:RandomString
rclone copy --update --verbose images/ ImagesUpload:DriveFolderName
rclone copy --drive-impersonate (Tried both service account email and drive folder email owner) --update --verbose images/ ImagesUpload:(I tried both the name of the folder and the identifier)

type = drive
scope = drive
service_account_file = /home/victor/.gdrive/gdrive.json
team_drive =

hello and welcome to the forum,

fwiw, you can create a remote using oAuth2 on one machine, then copy that config file to that machine.

I'd rather not use oAuth2 as the key eventually expires

sure, just a suggestion for a workaround until that real issue gets solved.

--- what is the output of rclone version?

--- might be easier to test using

  • rclone ls instead of rclone copy
  • add -vv for debug output.
    post that output enclosed with three backticks so it looks like
rclone version
rclone v1.56.2
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.16.8
- go/linking: static
- go/tags: none

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