File operations + filters

What is the problem you are having with rclone?

Rclone delete results in "can't limit to single files when using filters". I cannot see how my filters would affect this particular file. They are applied through environment variable.

Is there a way to ignore filters?

Run the command 'rclone version' and share the full output of the command.

rclone v1.61.1

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone delete -I "**path to a file**"

run the command with -vv for debug output
the easiest/safest way to test a filter is using rclone ls, not rclone delete

if you do not want to use filters, then do not use them.
do not set the environment variables.

I believe your reply misses the point entirely.

Filters do not include nor match—at all—the file in question.

Even -vvvv does not let us know anything more about the error.

Sorry as your post is somewhat vague/lacking details.

Can you describe what you've got set via the environment variables?

If you run -vv, you can see something like:

 rclone about GD: -vv
2023/02/26 16:54:30 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2023/02/26 16:54:30 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "about" "GD:" "-vv"]
2023/02/26 16:54:30 DEBUG : Creating backend with remote "GD:"
2023/02/26 16:54:30 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2023/02/26 16:54:30 DEBUG : GD: Loaded invalid token from config file - ignoring
2023/02/26 16:54:30 DEBUG : Saving config "token" in section "GD" of the config file
2023/02/26 16:54:30 DEBUG : Keeping previous permissions for config file: -rwxrwxr-x
2023/02/26 16:54:30 DEBUG : GD: Saved new token in config file
Total:   16 GiB
Used:    1.863 GiB
Free:    10.675 GiB
Trashed: 0 B
Other:   3.462 GiB
2023/02/26 16:54:31 DEBUG : 6 go routines active

What are you running here specifically and what is the error you are seeing with -vv and share the full output?

What's the output of rclone version as that gives us your OS and helps us understand your setup.

Thank you for your reply.

I didn't include the debug output, because there is nothing there really:

rclone delete -i "**file**" -vvvv
2023/02/27 07:58:12 DEBUG : Setting --exclude-from "[/**/ExclusionList.txt]" from environment variable RCLONE_EXCLUDE_FROM="/**/ExclusionList.txt"
2023/02/27 07:58:12 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "delete" "-i" "**file**" "-vvvv"]
2023/02/27 07:58:12 DEBUG : Creating backend with remote "**file**"
2023/02/27 07:58:12 DEBUG : Using config file from "/**/.rclone.conf"
2023/02/27 07:58:12 DEBUG : Creating backend with remote "******"
2023/02/27 07:58:12 DEBUG : ****: Loaded invalid token from config file - ignoring
2023/02/27 07:58:12 DEBUG : Saving config "token" in section "****" of the config file
2023/02/27 07:58:12 DEBUG : ****: Saved new token in config file
2023/02/27 07:58:16 DEBUG : fs cache: adding new entry for parent of "****", "****"
2023/02/27 07:58:16 can't limit to single files when using filters: ****

There is something special right there.

You can't use file is a command as it's looking for a file name. If you want to glob things, you have to use filters. The path/file name syntax expects a valid full path or a single file. If you want to use file, you need to use a filter.

You'd want to most likely unset the environment variable for exclude and use and include filter I'd imagine as I'm not sure your exact use case.

I think what is happening here is that "**file**" is actually a path to a file, not a glob pattern. The way rclone does stuff on single files is to install a filter just for that file and if it detects already existing filters then you get the "can't limit to single files when using filters" error.

So unsetting RCLONE_EXCLUDE_FROM would fix this.

Rclone being a bit cleverer about existing filters would fix it too!

Yes, **file** is a redacted full path.

Alright, so I will manually unset variable and then set it again after deleting files.

Thank you for your help!!

Ah! I think that was an unfortunate choice of redaction symbol in a question asking about filters :laughing:

That should do it :crossed_fingers:

:slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.