trouble with exclude_patterns #1021

Closed
opened 2025-03-09 16:08:43 +00:00 by robdavies · 6 comments

Hi

I'm having trouble with exclude_patterns, all of the excludes are being included in the backups. It used to work for me, I last made a backup a couple of borgmatic versions ago (just before .local/state was introduced). I have made a small change so don't know if its a change I made or a borgmatic change.

My exclude patters are :

exclude_patterns:
- ~/.config/borg
- ~/.local/state
- ~/.cache
- ~/.var/app//cache
- ~/.local/share/Trash
- ~/**/.dtrash
- ~/.mozilla/firefox/
/storage
- ~/.var/app//.mozilla/firefox//storage
- ~/.thunderbird//storage
- ~/.var/app/
/.thunderbird//storage
- ~/.thunderbird/
/ImapMail
- ~/.var/app//.thunderbird//ImapMail

I tried to change the firefox and thunderbird entries (see below) and that is when the problems started. I changed them back and the trouble continues.

- ~/**/.mozilla/firefox/*/storage
- ~/**/.thunderbird/*/storage
- ~/**/.thunderbird/*/ImapMail

Is there something I can do to fix/correct this?

Hi I'm having trouble with exclude_patterns, all of the excludes are being included in the backups. It used to work for me, I last made a backup a couple of borgmatic versions ago (just before .local/state was introduced). I have made a small change so don't know if its a change I made or a borgmatic change. My exclude patters are : exclude_patterns: - ~/.config/borg - ~/.local/state - ~/.cache - ~/.var/app/*/cache - ~/.local/share/Trash - ~/**/.dtrash - ~/.mozilla/firefox/*/storage - ~/.var/app/*/.mozilla/firefox/*/storage - ~/.thunderbird/*/storage - ~/.var/app/*/.thunderbird/*/storage - ~/.thunderbird/*/ImapMail - ~/.var/app/*/.thunderbird/*/ImapMail I tried to change the firefox and thunderbird entries (see below) and that is when the problems started. I changed them back and the trouble continues. - ~/**/.mozilla/firefox/*/storage - ~/**/.thunderbird/*/storage - ~/**/.thunderbird/*/ImapMail Is there something I can do to fix/correct this?
Owner

My guess is that support for ~ in exclude patterns was inadvertently broken by borgmatic 1.9.6—and initial testing seems to support that theory. You can verify this on your system by running borgmatic with --files and observing whether your expected files to exclude are actually excluded. And then if you change ~ to your actual home directory in the exclude_patterns, seeing whether that appears to fix the excluded files in --files output. ("x" indicates it's actually excluded.)

My guess is that support for `~` in exclude patterns was inadvertently broken by borgmatic 1.9.6—and initial testing seems to support that theory. You can verify this on your system by running borgmatic with `--files` and observing whether your expected files to exclude are actually excluded. And then if you change `~` to your actual home directory in the `exclude_patterns`, seeing whether that appears to fix the excluded files in `--files` output. ("x" indicates it's actually excluded.)
Author

Great thanks, I'll try that out. Can I use $HOME in exchange for ~ as the home directory in the config files?

Great thanks, I'll try that out. Can I use $HOME in exchange for ~ as the home directory in the config files?
Owner

You should be able to use ${HOME} for that, although this should hopefully be fixed soon and then you can continue using ~.

You should be able to use `${HOME}` for that, although this should hopefully be fixed soon and then you can continue using `~`.
Owner

This is fixed in main and will be part of the next release. Thanks for taking the time to report this!

This is fixed in main and will be part of the next release. Thanks for taking the time to report this!
Owner

Released in borgmatic 1.9.14!

Released in borgmatic 1.9.14!
Author

Thank you, that was quick.
You were right, when I replaced ~ with ${HOME} (in a test config file) and it worked. I can revert to using ~ and my original config file.

Thank you, that was quick. You were right, when I replaced ~ with ${HOME} (in a test config file) and it worked. I can revert to using ~ and my original config file.
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
borgmatic-collective/borgmatic#1021
No description provided.