Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exclusion handling for source size estimation #2206

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sersorrel
Copy link

@sersorrel sersorrel commented Feb 16, 2025

Description

Firstly: if there's an exclude pattern that starts with a #, it should be ignored when doing source size estimation. See borg help patterns:

Lines empty or starting with the number sign (‘#’) after removing whitespace on both ends are ignored.

Secondly: rather than just using the profile's exclude_patterns (text entered in the "raw" exclusions tab), we should estimate source size based on the combined set of patterns from the profile, including ExclusionModel etc. (the "presets" and "custom" tabs) – we do this by using the conveniently named get_combined_exclusion_string() method.

Related Issue

Fixes part of #2115.

Motivation and Context

Previously, only the "raw" exclusions were used when estimating size of a backup source, not the "presets" or "custom" exclusions. (All exclusions were still passed to Borg for the actual backup.) This could lead to over-estimating the amount of material to be backed up, or even traversing parts of the filesystem that should be ignored, like /proc or /run, and potentially crashing Vorta.

How Has This Been Tested?

I have not, yet, tested this – I have an ongoing backup I'd rather not interrupt, and running two instances of Vorta at the same time seems like a bad idea. I can do so next weekend, probably.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

@m3nu
Copy link
Contributor

m3nu commented Feb 17, 2025

This will pass more exclusions to the function sizing directories. So it's an improvement. It does NOT fix #2115 because it won't catch long filename errors from the OS. It also won't cover all exclusions, since the path is only compared as Regex, while Borg supports many more exclusion patterns.

I'm still OK to merge this, since it improves something.

@m3nu
Copy link
Contributor

m3nu commented Feb 17, 2025

Let us know when you tested this and we'll merge it.

@sersorrel
Copy link
Author

I've now tested this; it appears to work fine, the estimated size goes way down if I add a large directory to the "custom" tab (and the estimated size with no custom/preset options selected agrees with the stable Vorta I have installed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants