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

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.

Yep. It’s written up here.

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

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?

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.

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

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

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, …

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.

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.

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:"]

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).

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.

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.

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

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.

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

I think in addition to --dump config, it'd be nice to be able to specify a [default] section or something like that in the config with default values for options instead of shell env vars.

2 Likes