Edit service account while mounted

I've been asked to reopen this topic to continue discussion. Please keep this on topic:

1 Like

@random404 testing with a union and search policy eprand (from latest beta) appears to be showing promising results at the obvious overhead of requiring multiple remotes to be joined but that should only be a one time setup.

Nice I was just looking into this few days ago

saw a commit today adding this feature thanks a lot :slight_smile:

hmm maybe I was wrong, took a look at the code and only see set and get commands added so i'm guessing this doesn't reauth so it'll still be using the old SA account when mounted until the remote is remounted right?

Nope, the set command also performs a reauth with the new service account file.

oh cool i haven't tested it yet i'll give a try later

Is the reauth clean and transparent, or does it causes opened files to crash / glitch ?

Very transparent. :stuck_out_tongue: Works very well. Does not crash plex and such. Have 10 users watching stuff while switching between stuff.

usage :

./rclone backend get drive:  -o service_account_file
        "service_account_file": "/home/xxx/keys/2.json"

./rclone backend get drive:  -o service_account_file=/home/xxx/keys/2.json

        "service_account_file": {
                "current": "/home/xxx/keys/3.json",
                "previous": "/home/xxx/keys/2.json"

I just tried it added a service account which had no permission to the team drive but i could access the mount
i only got a error when i restarted the mount


Raise an issue on Github. Will add a check to handle this.

1 Like


done do let me know if you need me to do more tests

If you are hitting quotas which can't be cycled with sas, then you need to use my solution...it's been over 48 hours without 403 errors :slight_smile:

The only thing I had, is 503 errors but that's probably just google

1 Like

Nothing specific. Use it normally as you wish.

Also, saw the GH issue just now. @def_rclone you will need to use the rc example to change the service account file on a live mount. The backend command won't be able to do it, since it doesn't know which mount to connect to.

@darthShadow anyway to use this in rclone sync drive1: crypt1: --rc --no-auth ?
i did try it does acknowledge when I use rc backend to set a new service account

rc: "backend/command": with parameters map[command:set fs:test: opt:map[service_account_file:/home/user/.config/keys/4.json]]
2020-05-16 02:43:19 DEBUG : Changing Service Account File from /home/user/.config/keys/7.json to /home/user/.config/keys/4.json
2020-05-16 02:43:19 DEBUG : Saving config "service_account_file" = "/home/user/.config/keys/4.json" in section "test" of the config file
2020-05-16 02:43:19 DEBUG : Keeping previous permissions for config file: -rw-rw-r--
2020-05-16 02:43:19 DEBUG : rc: "backend/command": reply map[result:map[service_account_file:map[current:/home/user/.config/keys/4.json previous:/home/user/.config/keys/7.json]]]: <nil>

but doesn't use the new service account and just comes to halt when i hit the 750 GB limit on the SA account i started the transfer with

I usually used to use --drive-stop-on-upload-limit and then wrote a script to change service account and start the transfer again

But since --drive-stop-on-upload-limit makes the error be fatal when i use something like --transfers=20 and all files are above 40GB and transferred like 80% + and one file finished finished but i hit the 750GB limit rclone stops all the other transfers so wasted about almost (30GB*19) data everytime if i want to automate it

but if i could make this somehow work with rc backend set i can make my script to change service account every x hours like i now do with my mount

here's the complete commands i used
rclone --config=conf.conf sync drive: drivecrypt: --fast-list -vvvP --tpslimit-burst=50 --max-backlog=2000000 --ignore-case --no-update-modtime --drive-chunk-size=128M --use-mmap --transfers=12 --rc --rc-user=username--rc-pass=xxxx

rclone rc backend/command command=set fs=test: -o service_account_file=/home/user/.config/keys/4.json --rc-user=username --rc-pass=xxxx

There's a fork called gclone that does this. Google it.

That fork is great, I wish the feature was implemented into rclone.... but infact the gclone version can't use this for a mount only for copy/move/sync commands.

Hi ncw.
Curious if this is now able to change the active json for a running transfer with the backend command and v1.52? Or does it still require a stop/start to recognize the new json?

ty :slight_smile: