Skip to content

Adding Flatpak app caches to "All Cache Files" exclusion preset.#2232

Merged
m3nu merged 2 commits intoborgbase:masterfrom
CScallops:master
Jul 22, 2025
Merged

Adding Flatpak app caches to "All Cache Files" exclusion preset.#2232
m3nu merged 2 commits intoborgbase:masterfrom
CScallops:master

Conversation

@CScallops
Copy link
Contributor

Description

On temp.json, added a few more patterns to the "All Cache File" exclusion preset. Excluded directories:

  • *Cache dirs (though listed without a wildcard to avoid greedy matching);
  • .ld.so library linking cache;
  • tmp dir.

Related Issue

#2230

Motivation and Context

Going to Sources > Manage Excluded Items... > Presets and selecting "All Cache Files", Flatpak application caches are still included in backup. This fixes that.

How Has This Been Tested?

I've tested this by adding the proposed changes to the "Raw" exclusion patterns tab. I've also tested manually removing the dirs from a few few Flatpak apps and they regenerated these without issue on their next run.

Screenshots (if appropriate):

None.

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.

@VandalByte
Copy link
Collaborator

Looks great! Just a quick thought, for these newly added exclusions, could this be made more generalized?

"fm:*/.var/app/*/cache*",
"fm:*/.var/app/*/Cache*",
"fm:*/.var/app/*/*Cache*",
"fm:*/.var/app/*/tmp"

Please do test it out before deciding, this is just a suggestion from my side.

@CScallops
Copy link
Contributor Author

Looks great! Just a quick thought, for these newly added exclusions, could this be made more generalized?

So this is how I have on my exclusion list:

# Flatpak caches
fm:*/.var/app/*/cache
fm:*/.var/app/*/*Cache
fm:*/.var/app/*/.ld.so/*
fm:*/.var/app/*/tmp/*
fm:*/*/Crash Reports

The reason I didn't go with wildcard versions of the subdirectories is because I am not that familiar with the standard Flatpak directory structure (and couldn't find anything similar to a LSB for it). Now I don't mind risking not backing up some Flatpak app data on my system because it's not production critical. But I thought I'd play it safe with other people's systems and stick to the directories I have personally tested to be fine to be absent. I'd be surprised if there's an app out there that has an internal directory with "Cache" in its name that can't/shouldn't be deleted, but weirder things have happened.

So, what do you think? Go for it, or be more conservative and keep non-wildcarded dirs?

@VandalByte
Copy link
Collaborator

I'd play it safe with other people's systems and stick to the directories I have personally tested to be fine to be absent.

Yeah, I think that's fine. We can always add or adjust them later if needed.

@m3nu m3nu merged commit 7ccb27d into borgbase:master Jul 22, 2025
7 checks passed
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.

3 participants