exclude_patterns in config file also seem to be ignored since 1.9.6 #972
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
I have quite common exclude_patterns in my config file configured.
Since 1.9.6 borgmatic seems to look at least in the /proc/ directory trying to process some things there and throwing errors exiting with warninig status rc1. This seems similar to #970 and #971 but not the same so maybe not fixed yet.
1.9.5 works without warnings.
Steps to reproduce
source_directories:
- /
exclude_patterns:
- /dev/
- /proc/
- /run/
- /sys/
- /tmp/
...
Actual behavior
Expected behavior
The same behavior as with borgmatic 1.9.5.
Other notes / implementation ideas
No response
borgmatic version
1.9.6
borgmatic installation method
pipx
Borg version
No response
Python version
No response
Database version (if applicable)
No response
Operating system and version
No response
Super odd! I can't seem to reproduce this here, even with the same
source_directoriesandexclude_patterns. In borgmatic's verbose output, does the Borg command that's run (logged right after those patterns) include--patterns-fromalong with that/tmppatterns file path? Is there anything else in your configuration that might be relevant here?working_directory,exclude_from,patterns,patterns_from, etc? It might help to see your whole config file (redacted as needed).Another thing you can do is include
--filesin yourborgmatic createcommand to see what specific source files are getting archived. Additionally, if you don't want to do a whole backup, you can include--dry-runto simulate one. (/procpaths should be preceded byxin the--filesoutput to indicate they're excluded.)Thanks for the quick reply!
My setup has actually 2 different ssh repos as targets. A common config file (including the exclude patterns) is imported into each repo config file on execution as described in the reference. Works just fine with 1.9.5. I attached the config files.
Yes, it does:
Example --files output:
...
x /proc/452770/fdinfo/0
x /proc/452770/fdinfo/1
x /proc/452770/fdinfo/2
x /proc/452770/fdinfo/3
x /proc/452770/fdinfo/4
x /proc/452770/fdinfo/5
x /proc/452770/fdinfo/6
x /proc/452770/fdinfo/7
/proc/452770/fdinfo/7: stat: [Errno 2] No such file or directory: '7'
x /proc/452770/ns
...
Same issue here, except i'm usingexclude_fromwith files containing my exclusions, but they seem to be ignored.If you need more input i can provide you some too
Not related to this issue
@maxhamon I believe the
exclude_fromissue is separate and fixed in main. See #971.@iljur Thanks for the additional info. That
--filesoutput suggests that Borg is correctly excluding the/procfiles! ("x" means excluded.) So that would suggest the excludes are working correctly except, as you suggest, something appears to be "trying to process some things" in the excluded/procas part of thecreateaction. The fact that those "No such file or directory" errors seem to be interspersed directly within the Borg output makes me think they're coming from Borg. I'll look into this and see if I can repro it with your additional details and/or determine what's going on.Sorry for confusion guys, thanks for your great works
!
I'm not sure why this didn't happen for you with 1.9.5, but this Borg ticket seems to suggest that it's a known behavior of Borg. The dev's recommendation is, for
/procand/runin particular, to use a "no recurse" exclude pattern (!) instead of a standard exclude (-). Maybe try that for/procand see if the errors/warnings go away?EDIT: Also be aware of this other Borg issue; you might need to remove the trailing slash on the pattern. In fact, it might be a good idea to removing the trailing slash regardless.
My guess is that there is somehow a link between this issue and the new temporary pattern file that is generated by borgmatic 1.9.6 although it looks formaly alright. It really seems to be a borg issue though and not borgmatic related.
But anyway I solved my issue/warnings by switching to the following pattern file inspired by @dukelsky in the mentioned borg issue.
Like in the cited borg issue I want to include the directories, but not their contents. So the trailing slashes should be there... With the regex pattern also /proc is handled like expected with borgmatic 1.9.6.
But thanks anyway for the quick reply and your outstanding work on Borgmatic!
I'm glad to hear you have a work-around for now.. Hopefully there are no more surprises stemming from the 1.9.6 pattern changes! And thanks for using borgmatic and filing tickets!