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
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
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.
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?
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).
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?
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.
As there was no response yet, I was trying to dig deeper. In the file cmd/mountlib/rc.go there is no _filter option mentioned, so I assume @Animosity022 refered to the _filter injection from the rc documentation. There it is written
So I was trying according to the implementation in fs/filter/filter.go to use the ExcludeFile filter.
So I run:
rclone.exe -vvvv rc mount/mount fs=onedrive: mountPoint=%USERPROFILE%\Documents\OneDrive vfsOpt="{\"CacheMode\": 2, \"CacheMaxSize\": \"10737418240\"}" _filter="{\"ExcludeFile\": \".hide\"}"
2024/11/07 21:23:23 DEBUG : rclone: Version "v1.68.1" starting with parameters ["rclone.exe" "-vvvv" "rc" "mount/mount" "fs=onedrive-florian:" "mountPoint=C:\\Users\\***\\Documents\\OneDrive" "vfsOpt={\"CacheMode\": 2, \"CacheMaxSize\": \"10737418240\"}" "_filter={\"ExcludeFile\": \".hide\"}"]
2024/11/07 21:23:24 ERROR : rc: "mount/mount": error: key "_filter": json: cannot unmarshal string into Go struct field Options.ExcludeFile of type []string
{
"error": "key \"_filter\": json: cannot unmarshal string into Go struct field Options.ExcludeFile of type []string",
"input": {
"_filter": "{\"ExcludeFile\": \".hide\"}",
"fs": "onedrive:",
"mountPoint": "C:\\Users\\***\\Documents\\OneDrive",
"vfsOpt": "{\"CacheMode\": 2, \"CacheMaxSize\": \"10737418240\"}"
},
"path": "mount/mount",
"status": 400
}
2024/11/07 21:23:24 DEBUG : 4 go routines active
2024/11/07 21:23:24 NOTICE: Failed to rc: operation "mount/mount" failed: key "_filter": json: cannot unmarshal string into Go struct field Options.ExcludeFile of type []string
So I am really confused and according how I read the source and now the debug information, the documentation about the filters must be wrong and the filter options must be configured like @Animosity022 mentioned. But they don't throw an error and don't work either / are getting ignored.