Bulk add remotes?

Hey, not sure if this is something already possible and I just don't know how, but I'd like to add many google drive remotes at a time. Each team drive as it's own remote is a fine and workable setup, but going through the menu to add a new one each time gets a little tedious when 99% of the information is the same. In my situation there are about 20 team drives on the same domain, and while I can do the rclone config > copy > edit route to get another one once I've made one, that takes about as long as making a new one anyway. I've tried just editing the rclone config to do it, just changing the name and the drive ID, but then I get an error of "create oauth client: unexpected end of JSON input", so I imagine it's storing credential data somewhere else I'm not aware of. Ideally for me it would be cool when you get to the list of team drives screen to just have an "Add All" option, but I understand if that's not realistic. Some very long command line input with switches for every variable would be fine here too, as this is all going in a script eventually anyway.
If anyone has a tip for how to accomplish this any easier, or you need me to clarify anything, please let me know.

This should work. I suspect your editor is wrapping the very long lines or something like that. Can you try a different editor?

Note that you can swap team drives on the fly with

  --drive-team-drive string   ID of the Team Drive

which might help.

And you can create configs programatically with

$ rclone config create
Usage:
  rclone config create <name> <type> [<key> <value>]* [flags]

Yep, that was the issue, cheers! That's what I get for not working in my normal environment.

Ah, great, this is exactly what I was looking for. I suppose it was fairly obvious now that I think about it. This is certainly enough for me to write some scripts for everything else I need to do.

I'm still interested if anyone has already written something cool for importing large lists of drives(or remotes in general) from JSON, spreadsheets, databases, anything cool like that. Otherwise, problems solved, thanks a lot.

1 Like

Cool, I found this helpful too. Just a bit unsure though, is there are way of fetching all of these ID's for all of the OneDrive and SharePoint Sites? The only way I can see if going through the config wizard and making a note of them as you go.

Thanks

I've never used those services, but with Google drive I wrote like a 4 line python script to do it, with an API call to list the drives, and some regex to parse it into something easier to import into an rclone config. I'd be very surprised if the same is not possible in your situation. Best of luck with it!

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