Config Create to specific location

Hello I am trying to automate the creation of the rclone .config file and was wondering is there a string in config create to save the config to a certain location instead of the default.

Regards

Jack

You can set this environment variable to use a custom location:

RCLONE_CONFIG=/opt/rclone/rclone.conf

Hi thank you, this to point the software to a config file as I want to do config create and choose a location to save to. I think I have it now with the bit at the end of the command > "location"

Kind Regards

Jack

It's used to define the location of the file and is specific to what you asked:

felix@gemini:~$ export RCLONE_CONFIG=/tmp/test.conf
felix@gemini:~$ rclone config create myremote swift env_auth true
2020/03/23 11:56:28 NOTICE: Config file "/tmp/test.conf" not found - using defaults
Remote config
--------------------
[myremote]
type = swift
env_auth = true
--------------------
felix@gemini:~$ cat /tmp/test.conf
[myremote]
type = swift
env_auth = true

I have managed to create the file in a different location now but the

RCLONE_CONFIG=/opt/rclone/rclone.conf

is not working it is not changing the default location, don't know what I'm doing wrong?

kind regards

Jack

Can you share specifically all the commands you are doing? Are you mirroring what I have above in the command?

So I have a config file in /users/shared/rclone.config

run command RCLONE_CONFIG=/users/shared/rclone.config

nothing happens

Kind Regards

Jack

try export RCLONE_CONFIG=/users/shared/rclone.config

I have exported the file it is there in the new location but rclone is not seeing it and is still looking to the old location of ~/.config/rclone/rclone.conf

When I run the command rclone config it says Config file "/Users/USERNAME/.config/rclone/rclone.conf" not found - using defaults

I want it to be looking at /Users/Shared/rclone.conf

Kind Regards

Jack

https://rclone.org/docs/#config-config-file

Can you share specifically what you are doing/steps/typing them into the forum like I did a few posts above.

Use three backtics before and after your commands so it does a code block.

like
this

so I run these commands:

sudo rclone config create Sharepoint webdav url 'SITE URL' vendor sharepoint user 'USER@DOMAIN.COM pass 'PASSWORD' > /Users/Shared/rclone.conf

sudo rclone --config=/Users/Shared/rclone.conf

If you want to make a config at a specific location running as root, you can do:

felix@gemini:~$ sudo -- bash  -c 'export RCLONE_CONFIG=/tmp/test.conf;rclone config create myremote swift env_auth true'
2020/03/23 15:20:34 NOTICE: Config file "/tmp/test.conf" not found - using defaults
Remote config
--------------------
[myremote]
type = swift
env_auth = true
--------------------
felix@gemini:~$ ls -al /tmp/test.conf
-rw------- 1 root root 41 Mar 23 15:20 /tmp/test.conf

There are many ways to do it though so that's just 1 way that works for me.

I can make the config file that is not the problem, it is the second command, trying to point rclone to the config file in the different location as default. In your command above I can see the same error I got.

2020/03/23 15:20:34 NOTICE: Config file "/tmp/test.conf" not found - using defaults

You need to export it when you enter in the shell or make it permanent by using an environment variable in your .bashrc / .sh / .zshrc

My .bashrc has:

# RClone Config file
RCLONE_CONFIG=/opt/rclone/rclone.conf
export RCLONE_CONFIG

In it.

So I want to run a rclone sync using this conf how would I do that?

Kind regards

Jack

You'd have to set it using the export command in the shell you are running rclone sync in or you'd make it permanent by adding it into your shell's profile like I have for bash above.

export RCLONE_CONFIG=/opt/rclone/rclone.conf
rclone sync someremote: someotherremote:

Hello,

Thank you for your help so far I have got my head around the selecting the config file for my rclone commands. However now I seem to have a problem creating the conf file all together. Created a command.sh file to create rclone.conf. Works fine in terminal when I run it but put it in a package to run as root fails all the time creates a rclone.conf with zero bytes of data.

Kind Regards

Jack

Here is my script.sh

'''#/usr/local/bin/rclone

#Configure RClone to Sharepoint#

sudo rclone config create Sharepoint webdav url "URL" vendor sharepoint user "USER@DOMAIN.COM pass "PASSWORD" > /Users/Shared/rclone.conf'''

Works in terminal, however put into software Packages on my Mac and run as pre-install script as root and fails? Any ideas?

Kind Regards

Jack

Can you share an error message / screen shot or something? It fails really doesn't help us help you.