rustic icon indicating copy to clipboard operation
rustic copied to clipboard

Option to merge tags in config files

Open mentonin opened this issue 7 months ago • 0 comments

When backing up using config files, I would expect multiple tags declarations to be merged together. Instead, the first, most specific declaration is the only one considered. Some example cases:

# A.toml
[backup]
tags = [ "tag-A" ]
# B.toml
[backup]
tags = [ "tag-B" ]
# C.toml
[[backup.snapshots]]
tags = [ "tag-C" ]
  • rustic backup -P A -P B results in tag-A.
  • rustic backup -P A -P C results in tag-C.
  • rustic backup -P A -P C --tag tag-D results in tag-D.
  • rustic backup -P A -P C --tag tag-D --tag tag-E results in tag-D, tag-E.

I would expect every tag and --tag option to append to other tag declarations, both with multiple declarations and using use-profiles imports.

More specific use cases:

  • I want to create a config file with many snapshot declarations, where every snapshot is tagged with a common tag, but some might have extra tags.
  • I have a few modular config-files that I might apply on some backups, and want to tag those backups with each optional config used. For example, some combination of auto, manual, no-gitignore, no-backupignore, test, important

Overwriting tags may also be useful, of course. So maybe rustic would need to implement some kind of append-tags, exclude-tags, or something similar.

mentonin avatar Mar 23 '25 17:03 mentonin