The command restic snapshots --json --tag app=dbbackup --tag db=somedb
returns them both. The only way to return only the snapshot with the “db=somedb” tag is to remove --tag app=dbbackup. It seems that the tags are "or"ed together, so adding more tags casts a wider net. I would have expected it to make the search more specific. I didn’t see anything in the docs that specifically stated how it works. Are the tags “anded” or “ored”?
Looks like they’re “ored”. But do you have a special reason to rely only on restic’s snapshots command for excluding a tag? Asking since you can at least exclude some tags on forget command via --keep-tag flag.
@cmusser The snapshots command returns all snapshots which match all tags in any of the passed taglists. Your command restic snapshots --json --tag app=dbbackup --tag db=somedb passes two taglists app=dbbackup and db=somedb to restic, so the result returns any snapshot with tags app=dbbackup OR db=somedb. To only return snapshots with both tags specify them as one taglist: --tag app=dbbackup,db=somedb.