Missing documentation of rc options

What is the problem?

Hello everyone,
I am trying to figure out how to use the rc options with rclone. However I didn't find any documentation about the rc options. All documentation on rc refers to options/get. However you just get a list of valid option keys without any explanation of their supported values. Is it just me that I couldn't find anything? Or are they really not available?

As an example: I have the following command which runs perfectly from commandline:

rclone.exe mount onedrive: %USERPROFILE%\Documents\OneDrive --vfs-cache-mode full --vfs-cache-max-size 10G --vfs-cache-max-age 24h --exclude-if-present .hide --no-console

So i want to mount using the rc command:

rclone.exe rc mount/mount fs=onedrive: mountPoint=%USERPROFILE%\Documents\OneDrive vfsOpt="{\"CacheMode\": 2, \"CacheMaxSize\": \"10737418240\"}"

However I have no idea how to get the same result that folders with the .hide file are excluded using rc. With the help of options/get I figure, I probably have to fill the "ExtraFlags": [] or "ExtraOptions": [] variable within the mount section. However no clue what format I have to use as this is not documented anywhere. Also for the CacheMaxSize, I just used byte as the value format, but I'm not sure, if that is a correct value. It didn't throw an error though.

I would really appreciate some tipps, where I am able to get more documentation and information on how to use the options for the rc command.
Thanks everyone for your help.

rclone version

rclone v1.68.1
- os/version: Microsoft Windows 11 Pro 24H2 (64 bit)
- os/kernel: 10.0.26100.2161 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.23.1
- go/linking: static
- go/tags: cmount

Check out:

Remote Control / API

Thanks for your response.
Unfortunately this doesn't answer my question, because I am aware of this page, but there is the rc command line interface and the commands described - not the configuration options I was asking for.

They all go back to the other config docs.

What specific documentation are you looking for? What flags?

As mentioned in my first post, I want to use the following flag for the mount command:

--exclude-if-present .hide

Have nothing to mount, but a sync example that might work on a mount:

rclone rc sync/sync \
    srcFs=/path/to/source \
    dstFs=/path/to/destination \
    _filter='{"exclude_if_present": ".exclude_this_folder"}'

If filters work on a mount, that should be it.

Remote Control / API

If you want to tag a PR to update an example, that would be great.

I. On the problem

Thank you. That is very helpful hint. However unfortunately it seems not to work.

Modifying my command to

rclone.exe rc mount/mount \
    fs=onedrive: \
    mountPoint=%USERPROFILE%\Documents\OneDrive \
    vfsOpt="{\"CacheMode\": 2, \"CacheMaxSize\": \"10737418240\"}" \
    _filter="{\"exclude_if_present\": \".hide\"}"

will indeed mount the volume without errors. However the folder with the .hide-File is still present and not filtered. So it seems not to work equivalently to the --exclude-if-present .hide option.

II. In general

Furthermore after double checking on the docs, I wouldn't have come up with this solution. Shouldn't it be more helpful to provide a comprehensive documentation, where all the options are described?

Can you share a debug log? I'd imagine that might not be passing but only a log would really tell.

That's not really my choice per se as it's community driven. If you want something more documented, it's open source, feel free to add.

_filter='{"exclude_if_present": ".exclude_this_folder"}'

This may also the source of @f0sh's issues. I am 99% sure it is ExcludeFile, not exclude_if_present. Unless there are aliases and I missed the documentation of them (or it's undocumented).

See:

$  rclone rc --loopback options/get
{
    ...
    "filter": {
        ...
        "ExcludeFile": [],
        ...
    },
    ...
}

Or does _filter behave differently?


If it helps, below is my Python dictionary that maps command line to _filter. Though it is possible that it is out of date

param2flag = {
    "DeleteExcluded": "--delete-excluded",
    "FilterRule": "--filter",
    "FilterFrom": "--filter-from",
    "ExcludeRule": "--exclude",
    "ExcludeFrom": "--exclude-from",
    "IncludeRule": "--include",
    "IncludeFrom": "--include-from",
    "ExcludeFile": "--exclude-if-present",
    "FilesFrom": "--files-from",
    "FilesFromRaw": "--files-from-raw",
    "MinAge": "--min-age",
    "MaxAge": "--max-age",
    "MinSize": "--min-size",
    "MaxSize": "--max-size",
    "IgnoreCase": "--ignore-case",
    "meta_FilterRule": "--metadata-filter",
    "meta_FilterFrom": "--metadata-filter-from",
    "meta_ExcludeRule": "--metadata-exclude",
    "meta_ExcludeFrom": "--metadata-exclude-from",
    "meta_IncludeRule": "--metadata-include",
    "meta_IncludeFrom": "--metadata-include-from",
}
# Specify types if not list
BOOL_PARAMS = {"IgnoreCase", "DeleteExcluded"}
SINGLE_PARAMS = {"MinAge", "MaxAge", "MinSize", "MaxSize"}

I think that's right from checking the source:

On the problem

rclone.exe -vvvv rc mount/mount fs=onedrive: mountPoint=%USERPROFILE%\Documents\OneDrive vfsOpt="{\"CacheMode\": 2, \"CacheMaxSize\": \"10737418240\"}" _filter="{\"exclude_if_present\": \".hide\"}"
2024/11/04 18:56:06 DEBUG : rclone: Version "v1.68.1" starting with parameters ["rclone.exe" "-vvvv" "rc" "mount/mount" "fs=onedrive:" "mountPoint=C:\\Users\\***\\Documents\\OneDrive" "vfsOpt={\"CacheMode\": 2, \"CacheMaxSize\": \"10737418240\"}" "_filter={\"exclude_if_present\": \".hide\"}"]
{}
2024/11/04 18:56:06 DEBUG : 4 go routines active

There is no other output. Is there any other option to generate debug information?

On the documentation

According to the documentation the

Option exclude-if-present creates a directory exclude rule based on the presence of a file in a directory and takes precedence over other rclone directory filter rules.

I couldn't find anything about the ExcludeFile directive even so I was using google. Where did you get that from?

That's awesome :star_struck: Thank you.

Not to be pedantic, but this isn't clear. Are you saying ExcludeFile is right or exclude_if_present?

Well, this may be to the point of missing documentation. It isn't there. It was a while ago that I made that mapping but I am pretty sure I did it with rclone rc --loopback options/get plus a combination of deductive reasoning and trial and error.