-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Here is an example config:
[backup]
globs = ["!.DS_Store", "!._*", "!.DocumentRevisions-*", "!.Spotlight-*", "!.TemporaryItems", "!.Trashes", "!.fseventsd"]
[[backup.snapshots]]
name = "Dotfiles"
sources = ["/Users/me/.config"]
globs = ["!*.sock", "!history.txt"]When backing up files from ~/.config, the backup.globs config is ignored, because it's overridden by the globs list in the Dotfiles snapshot definition. So a file like ~/.config/foo/.DS_Store will be backed up.
I expected both lists of globs to be considered (i.e. merging the two lists), but it looks like one overrides the other.
I don’t know if that’s a bug. Probably not? It was a bit unintuitive for me, but it kinda makes sense. If the lists were magically merged, then it would be impossible to override backup.globs when you actually want to.
The workarounds I’ve found all rely on using different options to define excludes at the global and snapshot-specific level:
- Use
backup.iglobsfor shared rules, andglobsfor specific snapshots. - Use
backup.glob-filesfor shared rules, andglobsoriglobsfor specific snapshots. - Use
backup.globsfor shared rules, and.backupignorefiles in the source folders for specific snapshots. - etc.
I don't know if there's anything to do here. It was a bit of a gotcha for me, so I thought I'd raise the issue, but I’m okay with closing it if no one has an idea for improvement.