Edit service account while mounted

Is it possible to edit the service_account_file flag from rclone.conf while that remote is mounted? Will usage of the mount go through the current value of service_account_file or will it use the one from when the mount was originally created (meaning a mount restart is necessary)?

EDIT: would running the following command achieve this?

rclone config update remote service_account_file /path/to/file.json


Test it out and check the debug log and see if it works.

What am I looking for exactly? I don't see anything in the debug logs stating what file was used.

If nothing is shown, you can check your API hits in the console as well and see if the new one is being used.

I didn't find anything in the log but looking at API activity it looks like changing in place does not work when mounted and traffic sticks to whatever service account was set when mounted.

@ncw is there any command that can be sent to force a refresh without needing tor restart the mount?

What's your use case in changing the credentials of a mount?

Large library and multiple users so run into API bans every once in a while. Wanted to split those hits across two SA's.

What do you mean banned? You mean you hit the API quota for upload or download?

Download quota, yes

So the use case, you have some event or trigger and want to change the service accounts on the mount dynamically as the only way to do that now is to remount.

You could always use something like mergerfs and round robin requests on multiple mounts or split the mounts up into a service account for a section or something.

I guess it depends on how problematic the download issue is.

I did. It's bugged: https://github.com/trapexit/mergerfs/issues/742

The dev has suggested a workaround, let's see if that works.

Did it work with reading files or was just find the issue?

I haven't tested his suggestion but before it didn't work, plex saw a lot of the content as unavailable when mergerfs ran like that.

Use rclone union instead of mergerfs, been running with it and so far it's all good.

Just don't know how to do the same mergerfs policies but just the defaults are working for my merge.

And I have always switched the service account while mounted and I think it's always worked for me

So you have a union that specifies the cloud remote and the local path and you mount the union without using mergerfs? And in these conditions you can update the account in place without unmounting? Sounds promising, I'll give this a shot.

EDIT: nope, it's not working for me. Just tested it out, mounted it on a temp location and have a script running that edits the service account and I'm listing the entire directory structure. There are list hits only in one of the accounts.

I don't ever write to the union mount, just read from it...

type = union
remotes = 1: 2: 3:

Then I Just update the service accounts of the remotes 1: 2: 3: and I mount the union.

After I did this I never had issues again. I think you can do more complex stuff but I don't know...

1: is my main remote, and the others are just backups

Do you restart the union after changing any of the service accounts?


What I'd like is a way to make it read 1: first, since the backups are not always in sync

How do you validate that you're using the different service accounts?

I'm not 100% sure but I never had any issues again