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
231 stars 37 forks source link

Add switch to enable sync based on ratio of added to deleted files #38

Closed tehniemer closed 2 years ago

tehniemer commented 2 years ago

This allows a sync if the ratio of added to deleted files exceeds a user defined threshold, even if the delete threshold is exceeded. This is useful in the cases where files are being modified in a way that snapraid sees as adding and deleting rather than updating. Examples of this would be transcoding video files to different formats or a rolling backup service.

phidauex commented 2 years ago

This looks handy! I've had to set my threshold very high since one of my groups of files is chunks from a Proxmox Backup Server, and when it runs it tends to add and remove a TON of files (12k+), but the ratio between them is very similar since it is just creating a new backup and pruning the oldest.

auanasgheps commented 2 years ago

This looks super cool! Always a big thank you for your PRs.

I am travelling, will review and merge when I'll be back!

auanasgheps commented 2 years ago

hI @tehniemer looks like you got lost with ADD_DEL_RATIO and ADD_DEL_THRESHOLD. The latter is mentioned in the code, but not declared.

tehniemer commented 2 years ago

Woops, missed that transferring the changes from my working copy to the repo. Should be fixed now.

tehniemer commented 2 years ago

@auanasgheps this should be good to merge now.

auanasgheps commented 2 years ago

@tehniemer sorry for the huge delay, I didn't had the time to look at this project.

I've tested the updated code and works great!

Thanks for your contribution and your patience :)

tehniemer commented 2 years ago

No worries, it's been rock solid for me. I like to give back when I can.

I've been working on another enhancement that I was just about to submit a pull request for, so your return is well timed.