Can all command line options be in rclone.conf file?


#1

In particular, can we specify fast-list = true and transfers = 32 in rclone.conf file for B2 storage? If, yes, not sure how to map them to the config file, e.g. for crypt remote command line flag --crypt-directory-name-encryption appears in the config file as directory_name_encryption

I’m using rclone as a backend for restic (I’m very new to both of them) and not sure how to pass options from restic to rclone otherwise, I figured the config file would be the way.


#2

Yep. It’s written up here.

https://rclone.org/docs/#environment-variables


#3

Helpful but doesn’t quite answer my question. I’m interested in what goes in the config file, not env variables, e.g. is it fast-list or fast_list in the config file?


#4

I do not know what the problem is, I found that the rclone configuration file does not have those parameters by default. You can type that code and remember to mask the important tokens.


#5
  --fast-list                                  Use recursive list if available. Uses more memory but fewer transactions.

#6

I don’t see fast-list as being able to go into the config file so you’d need to use an environment variable.


#7

What about transfers? How do we know what can and what cannot go in the config file? This is confusing, command line flags, env variables, config file, …


#8

I do believe that one looks to be there:

RCLONE_CONFIG_MYREMOTE_TRANSFERS=8

With switching out your remote name.

I think the goal was to get them all in the config, but not sure that has completed yet.

I personally like the environment variables better, but see the need for having it all in a config file.


#9

But again the question is can transfers go in the config file? How can one tell whether it does anything once in there? Looks like I can put anything in the config file and it may work or may get ignored.

It would be nice to have a flag on the command line that shows the final configuration that is used after processing cmd line flags, env variables, rclone.conf file and all the override rules.


#10

That’s the syntax I shared for the config file.

You can run a command with debug to see the parameters passed:

rclone -vvv lsd gcrypt:
2018/12/18 12:50:16 DEBUG : rclone: Version "v1.45" starting with parameters ["rclone" "-vvv" "lsd" "gcrypt:"]

#11

You shared the env var for transfers RCLONE_CONFIG_MYREMOTE_TRANSFERS but still unclear to me how things map from cmd line flags or env vars into config file options.

And just to be clear we are not talking about shell scripts or some other config files, by config file I mean ~/.config/rclone/rclone.conf (at least on Linux, on other systems whatever rclone config file may print).


#12

Sorry as I misunderstood!

I don’t believe they can go into the config file but I’d go the other way. You can have a script that has all the environment variables doing the same thing.

That would accomplish the same goal without using the config file at all.


#13

Hopefully when rclone is started by restic it gets the env vars.

So for --fast-list what would the env variable be? RCLONE_CONFIG_B2_FAST_LIST=true or just RCLONE_CONFIG_FAST_LIST=true?

My remote is called b2 but have a crypt remote that uses it called b2crypt so not sure which one to specify in the env var name.


#14

It does I think.

The latter. Any configs which have a backend name in can go in the config file eg --b2-hard-delete any without can’t. So --fast-list becomes RCLONE_CONFIG_FAST_LIST=true


#15

Thank you for clarifying. Is there any way to see the “final” list of config values after cmd line, env vars, config file are all processed? Hard to tell if some of these options are honored, there can be spelling mistakes, etc.


#16

There isn’t at the moment, no. It is a nice idea though. Maybe --dump config could show the results of each config item.