auanasgheps / snapraid-aio-script

The definitive all-in-one SnapRAID script on Linux. Diff, sync, scrub are things of the past. Manage SnapRAID and much, much more!
GNU General Public License v3.0
239 stars 37 forks source link

[DRAFT] Ignore Pattern for file count #71

Closed Wastus closed 4 months ago

Wastus commented 1 year ago

This is a solution to fix #70. It's not pretty but it works, though users should test the pattern thoroughly to not exclude to many items.

I've done some rudimentary tests.

tehniemer commented 6 months ago

@auanasgheps did you mean to close this?

auanasgheps commented 6 months ago

I did not close this. But got closed automatically as dev branch got merged into main.

tehniemer commented 6 months ago

This was closed again when dev was merged.

I have been testing this for a while now and it seems to be working as intended.

auanasgheps commented 6 months ago

Apologies, It gets closed automatically when I push dev to master.

@tehniemer do you think we should make it better?

I've never used regex and I can't get a working pattern. Does not seem to be user friendly

auanasgheps commented 6 months ago

Ok, maybe I got it: using the example as a reference, the number of the matches is the number of files that will be included after the filter.

If I enter *.mkv in the filter I get 8 matches, none of the matched files contains *.mkv (are 2, which are excluded)

tehniemer commented 6 months ago

I've never used regex and I can't get a working pattern. Does not seem to be user friendly

Regex isn't user friendly at all in my experience, I've always had to use an online regex generator/tester to come up with my filters. This is a pretty advanced function, and a warning should be included for users to take the time to test their patterns and understand the risks.

I've only tested using two partial file paths as I have entire folders that I don't want to be included in the counts, rather than an extension. My understanding is that this will not include anything in counts that includes the pattern in the absolute file path, and it doesn't tell you what's being ignored. It might be a good idea to add a count of files that are being ignored and include that list in the full report.

tehniemer commented 4 months ago

I've been running with this feature for quite a while now and it's been pretty great at filtering out noise from locations that have frequent changes like borg backup and proxmox backup server directories. I have added some additional functionality to my version to log the ignored file count, which is nice to see IMO.

I'm not sure how to properly indicate the changes I made in this PR, so I'll just link to my fork for review.

auanasgheps commented 4 months ago

Hi @tehniemer, I would definitely consider your work which logs the ignored file count.

You can make another PR to this repo and we'll mention that @Wastus did the original work

auanasgheps commented 4 months ago

I had a look at it, it looks super clean :)