How to configure a service account for a personal Google Drive?

I need to backup my server data to Google Drive.
It's a personal account.
I tried to create a service account, initially without any role
Which roles must I give to service account to be able to create and delete folders and files?

I create in my Drive root a folder for rclone, and this folder has an id

1HjnJBoUEpqdV_.....

Actually I have this problem

failed to copy: failed to make directory: googleapi: Error 404: File not found: 1HjnJBoUEpqdV_..., notFound

I cannot autoconfigure server so I choosen to create json file for a service account and used it.

Login is working but... cannot see the directory

This is my config

[GDrive_DFS]
type = drive
scope = drive
root_folder_id = 1HjnJBoUEpqdV_.....
service_account_file = /home/server_user/backup-file-e-db-su-gdrive-fe18a3c5630b.json
team_drive =

As you can see, I gave 'drive' scope to rclone to be able to do almost everything.

Every service account is effectively a new user with its own home directory and its own 15GB initial quota - that's why you can't see any of your files.

To access your files you need to use --drive-impersonate you@gmail.com to tell the service account to look at your files rather than its own files.

However I don't think this works with google drive personal accounts - at least it didn't last time I tried it. It only works with multi-user enterprise accounts (or whatever they are called today!).

I'm not a google drive expert though so maybe there is a way of getting it to work.

You can't.

You need access to a GSuite Admin console to give the service account permissions needed to see the Google Drive stuff. You can login without issue but wouldn't be able to use the Drive API.

1 Like

Thanks for your suggestion. I have no idea of how to do this in gsuite admin...

I shared wth the service account the folder where to place files from rclone

Now it's working but I got an error

Failed to copy: googleapi: Error 403: The user's Drive storage quota has been exceeded., storageQuotaExceeded

Impossible !!! I've 2 TB of space, min 700G free.

I do not uploaded a lot of data so I've not of course excedded daily quota (if any, I don't kwow)

You can't as there is no GSuite Admin for non GSuite accounts.

Right, you can't as you aren't a GSuite account so you have no space/storage/etc. Sharing with it won't work either.

The service accounts to meant to be used with GSuite and not a personal account.

The user in question is the service account user I think which has a 15GB quota.

Check the ownership of the files you uploaded in the web interface.

So what should I do to do a GDrive backup with mega? the doc is all but clear. Sorry.

With a GSuite Service account, you get 15GB, I don't think with a personal account anything.

Mega has quite the rate limiting.

You make a remote for Google. You make a remote for Mega.

You can use rclone copy or sync depending on what you want to do.

I'd strongly advise against using a service account with your personal account. I can't be more clear, but do as you like. You'll end creating more problems than you are solving.

1 Like

Ok, no problem. Tell me what to do, please, to use a standard account to do sync on Drive using rclone.

I've only ONE user.
I cannot do interactive login on a ssh session
I can't understand how to get the .json from my GSuite User Account

No need for a service account, just set up rclone normally using oauth. Rclone will renew the tokens as necessary and it will carry on working.

just set up rclone normally using oauth

How can I use oauth? I am on a server, cannot open a browser !

hi,
there are two ways documented at
https://rclone.org/remote_setup/

--- run rclone config on a computer with a web browser and then copy the rclone config file to the headless server
--- follow the steps outlined at

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