Inverting all filters? Or listing skipped?

Is it possible to invert filters? Or, list everything that got filtered without some crazy grep action?

One idea I had was to try something like:

Original

+ some/file.txt
- some/**
- other/complex/*/pattern.ext

to

- some/file.txt
+ some/**
+ other/complex/*/pattern.ext

# Get everything else!
- **

would that work? Are there some edge-cases I am missing?

Just to make sure I am not XYprobleming, I have an rclone script to do a backup (with --backup-dir) and lots of filters for things I don't care about. But, there are things where I would like to know what I had in case I need to restore. For example, I do not need to back up my python virtual environments but I want to know what's there so I can recover. I would do some kind of ls flag with the inverted filters ans save that

This is certainly not mission critical but I would still like to add it.

I think that will work - change every + to - and vice versa in the filters file.

With one caveat - the filters file has an implicit + * rule on the end - you want to add that in explicitly so you can invert it.

Thanks. I added - ** at the end of my example. I guess I should have just done a single star.

Like I said, I suspected this would work but I was afraid there was some odd case I was missing.

1 Like

Either will match anything so whichever you prefer!

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