Is it possible to manipulate config using external script?


#1

Hmmm, not sure how to articulate this question because searching forum seems to only reference situations where an EXISTING rclone.conf can be replicated and also sliced/diced by an external script.

Rather, I am asking whether it is technically feasible to script the config process itself, from [New Remote] creation through [auto-config] for tokens where required.

An example situation would be for Onedrive on Windows, which automates the browser authentication, using cmd.

Thank you in advance for your time and attention and this miraculous product.


#2

I’ve been adding subcommands to config in the latest beta - check those out

Available Commands:
  create      Create a new remote with name, type and options.
  delete      Delete an existing remote <name>.
  dump        Dump the config file as JSON.
  edit        Enter an interactive configuration session.
  file        Show path of configuration file in use.
  providers   List in JSON format all the providers and options.
  show        Print (decrypted) config file, or the config for a single remote.
  update      Update options in an existing remote.

Take a look at that and tell me what is missing!


#3

Downloaded your latest (11/9/2017, 4:44:11 PM) windows 32-bit beta.

However, no luck inferring, stumbling upon, or reading about precisely how to use the “subcommands” you listed on my command line.

Assume i am overlooking something quite obvious so may i trouble you for guidance or perhaps an example.

Thank you in advance.


#4

Start with rclone --help - that gives you a list of subcommands, next rclone config --help, repeat for the subcommands rclone config dump --help. After the release they will have proper docs on the website made from those help pages.


#5

Ah Ha !!! Now it makes sense. Thank you. Will report back regarding attempts to use.


#6

Hello Nick,

config commands work nicely. singular issue is that the password from the command line produces the following …

… when show config
pass = *** ENCRYPTED ***

… when try to run ls
2018/04/30 15:06:13 Failed to create file system for “cmd-configed:”: input too short when revealing password - is it obscured?

… then, in the same conf file, just updating the password through the menu fixes it and everything works.

can you see what i might be doing wrong ???

thanks.


#7

You need to obscure the password with rclone obscure MYPASSWORD before sticking it in the config.


#8

Ah Ha !!! Now it makes sense. Thank you. Will report back :wink:


#9

Perfect !!! Thank you Sir.


#10

Hello Nick,

Rats … rclone obscure seems to interpret the ampersand “&” as seen below:

rclone obscure J
d2638d4xmp4XA_7uzYcVNoQ

rclone obscure Jg
2PZEa6Y_CiQDEcw_7kAvUYnP

rclone obscure Jg&
BM_6ACRPaT72VHeII-LYDgab

rclone obscure Jg&C
mQTauvqUg77-v-o33ErmaINR
‘C’ is not recognized as an internal or external command,
operable program or batch file.


#11

That is your shell rather than rclone…

Put the password in single quotes is the best way '. Note this means you can’t have a single quote in the password though…

What language are you writing this in? If something like python then read up on how to call commands not using the shell.


#12

Hello Nick,

Ah, that makes sense … this is at the windows cmd … tried using quotes as instructued:

  • Single quotes do NOT work
  • Double quotes DO work; so that is resolved

Thank you Sir.


#13

Great, glad you got it to work :smiley: I missed you were using windows - sorry!