Batch creation of rclone.conf

How can I automate generation of configuration files?

I have everything figured out except for the remote password. We are backing up to a Webdav server.

I think I have solved this one, if the remote’s name is “RemoteShare” and password is “P@ssw0rd”, executing:
rclone config password RemoteShare pass P@ssw0rd

Gets the job done. I was overthinking the user manual.


You can also use rclone obscure PASSWORD to generate the encrypted version of PASSWORD.

rclone obscure is a superior approach.

I will use something like this to build my configuration files:
set pw=HelloWorld
set out=c:\Backup\rc-%un%.conf
for /f %%i in (‘rclone obscure %pw%’) do set pw=%%i
echo [rc-%un%]>%out%
echo type = webdav>>%out%
echo url =>>%out%
echo vendor = other>>%out%
echo user = %un%>>%out%
echo pass = %pw%>>%out%

Thank you!

1 Like