Vorta: Better exclude options

Created on 17 Jun 2020  Â·  10Comments  Â·  Source: borgbase/vorta

Is your feature request related to a problem? Please describe.

I recently started using Vorta (and Borg); it's great, but I don't find the _exclude patterns_ business very friendly or intuitive — compared to other applications I've used that employ "similar approaches".

For instance, if I add my home folder as part of the source files/folders to backup, let's say: /home/x80486, and then use these patterns:

**/.gradle
**/.terraform

...Vorta (or Borg) will scan, recursively, every single subdirectory (starting from /home/x80486) and exclude everything that looks like .gradle and .terraform. The issue is, I just want to exclude those two at the /home/x80486 level, but not at any other depth/level.

Probably it's just me that I don't know how to express the correct pattern for that, but I can't find how to do such thing in the Borg/Vorta documentation.

Also, using:

.gradle
.terraform

...doesn't do anything, which is what I would expect to work because I'm giving the _root_ path to start scanning from already.

Describe the solution you'd like

To be able to accept relative and absolute paths accordingly to the input in the sources. For instance, if I provide /home/x80486 as source, and the following list as patterns:

**/.idea
**/node_modules
.gradle
.terraform

...I would expect Vorta to backup everything inside /home/x80486 except:

  • Any .idea subdirectory found (recursively) in any subdirectory
  • Any node_modules subdirectory found (recursively) in any subdirectory
  • The .gradle subdirectory found at /home/x80486 level, but not any other
  • The .terraform subdirectory found at /home/x80486 level, but not any other

Describe alternatives you've considered

None :rofl:

Most helpful comment

@x80486 isn't that what you need?:

/home/x80486/**/.idea
/home/x80486/**/node_modules
/home/x80486/.gradle
/home/x80486/.terraform

Untested, please carefully try yourself.

All 10 comments

Could you add .nobackup to Exclude if Present, and put .nobackup in .gradle and .terraform?

Indeed, I explored that also, but turns out a good amount of the subdirectories I have in the exclusion list are wiped out and recreated with some frequency, so I would have to come back and copy again the .nobackup file on all of them.

What I put is just a very small amount of folder/files that I'm excluding.

Try making .nobackup undeletable (chattr +i .nobackup)

Found this https://manpages.debian.org/testing/borgbackup/borg-patterns.1.en.html. Path prefix and path full-match might be useful

@x80486 isn't that what you need?:

/home/x80486/**/.idea
/home/x80486/**/node_modules
/home/x80486/.gradle
/home/x80486/.terraform

Untested, please carefully try yourself.

Indeed, but what I was saying was that since we already provided the source path, there shouldn't be a need to specify it again on every exclude entry because it should be inferred, right? Although reading through Borg I can see that it should be done in such way.

In any case, what you wrote there (augmented) works for me :partying_face: :trophy: :tropical_drink:

/home/x80486/.asdf
/home/x80486/.cache
/home/x80486/.gradle
/home/x80486/.gradle-kotlin-dsl
/home/x80486/.java
/home/x80486/.local/share/Trash
/home/x80486/.m2
/home/x80486/.nix-defexpr
/home/x80486/.nix-profile
/home/x80486/.swt
/home/x80486/.terraform.d
/home/x80486/.var
/home/x80486/.vgrive
/home/x80486/.bash_history
/home/x80486/.esd_auth
/home/x80486/.ICEauthority
/home/x80486/.node_repl_history
/home/x80486/HalfAssAppImages
/home/x80486/Desktop
/home/x80486/Workshop/**/.idea
/home/x80486/Workshop/**/node_modules
/home/x80486/Workshop/**/*.iml
/home/x80486/Workshop/**/*.ipr

There's no relationship between roots and exclude patterns in borg.

And changing that would be a major change of behaviour (although not a total compatibility break), which we could only do when doing a new release, like 1.2 or 1.3.

But there is nobody working on that and it is also not a topic for the vorta issue tracker.

OK, @ThomasWaldmann, I get your point. I think I'll leave it open but feel free to close if you think it's not an issue or unrelated with Vorta somehow...by the way, before leaving you alone, is there a way to exclude a directory, but include some parts/paths of it at the same time? Something like:

/home/x80486/.local                      # Exclude .local/
!/home/x80486/.local/share/JetBrains     # ...but include what's in .local/share/JetBrains/

borg takes the first matching rule, so more special / strict matches need to come before more general / less strict matches. read the borg help patterns output or the docs on the web.

Closing, since it's not really related to Vorta.

There is another issue to discuss GUI exclude improvments: #399

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jans23 picture jans23  Â·  13Comments

michaelmcneff picture michaelmcneff  Â·  3Comments

hutson picture hutson  Â·  8Comments

penyuan picture penyuan  Â·  5Comments

d5ve picture d5ve  Â·  11Comments