Problems filtering an application

What is the problem you are having with rclone?

MacOS is friendly enough to force downloading the next macOS system to the hard drive if you haven't upgraded yet, so I'd love to exclude that uploading from rclone and wasting space on my remote too. I used a filter for that and while usually I have no problems filtering folders, I seem to have problems excluding that specific app.

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

  • os/version: darwin 11.6.6 (64 bit)
  • os/kernel: 20.6.0 (x86_64)
  • os/type: darwin
  • os/arch: amd64
  • go/version: go1.18.1
  • go/linking: dynamic
  • go/tags: none

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)

no problems with the command, that works self, but having problems with the filter. This is what I use in the filter regarding the Applications folder and the app that I don't want to be uploaded.

+ /Applications/**
- /Applications/Install\ macOS\ Monterey.app

as applications kind of are folders I also tried this filter (without success)

- /Applications/Install\ macOS\ Monterey.app/**

The rclone config contents with secrets removed.

not necessary in this case

A log from the command with the -vv flag

I'm not sure if a log would help here, if so, I apologise for not including it and will quickly submit it.

Thanks a lot in advance, I'm sure it's quiet easy and I'm just stuck.

You want to switch the order of those two lines.

The filters are matched in order starting from the top until a match is found so your exclude will be ignored.

I don't think the backslashes are needed either.

Hello Nick, thanks for the answer (big fan of your work).

Unfortunately this didn't work, I now have the filter set up like this:

# Applications
- /Applications/Install macOS Monterey.app
+ /Applications/**

... but still rclone uploads this file

 * Applications/Install m…port/SharedSupport.dmg:  5% /11.272Gi, 1.293Mi/s, 2h20m37s

The path isn't shown completely, but I checked and know that the SharedSupport.dmg file is inside the 'Install macOS Monterey.app'. I also tried excluding this specific file too by the way, but without success.

I'm not sure about the backslashes, because I needed to insert them all the time for folder paths, but if they don't need to be used in file names, it's good to know!

Test your filter with rclone lsf -R --filter /path/to/filter /path/to/files which will do the listing using the filters.

Your filter is missing an exclude everything else line at the bottom - if the matcher falls off the bottom of the filter it includes the file.

- /Applications/Install macOS Monterey.app
+ /Applications/**
- *

Hello Nick!
Thanks so much for the help and explanation, and sorry for the late reply. I now included the 'exclude everything else line', but still, the 'Install macOS Monterey.app' is being uploaded. – I now wanted to test the filters, but failed – getting this error:

Failed to load filters: malformed rule path/to/filter

It seems like the path to the filter isn't working, but it actually is, as Rclone is only uploading the Applications-folder. However, it doesn't exclude this specific macOs Monterey.app.

To be more specific, this is what I tried to type

rclone lsf -R --filter /Users/jan/Library/Mobile\ Documents/com\~apple\~CloudDocs/Rclone/Backups/Filter\ –\ Jan\ Mac\ SSD.txt /

As the "path/to/files" I only included the "/", as this is what I included in the rclone backup command. But maybe somethings wrong again here.

Thanks so much in advance and have a good day.

Remember each rule needs to start with + or -

I think it does:

- /Applications/Install macOS Monterey.app
+ /Applications/**
- *

This is what my filter txt-file looks like I'm pathing to.

There is apparently anything wrong with that. Though the error message says otherwise! It comes from a very specific part of the code which is checking for the +/- prefix.

Check there isn't a blank line on the end.

Have check the txt twice, couldn't find an issue. For the sake of simplicity, here is a screen recording, maybe it's easier to point to what I did wrong here:

Sorry for the mess :confused:

I see the problem now! You need to use --filter-from to read the filter from a file not --filter