Multiple Backup Tags taken as one tag

While the forget/other commands have historically supported tag lists --tag cats,dogs - backup did not support this, unbeknownst to me.

I’ve unintentionally created the tag “automated,config”, rather than “automated”,“config”
Because of the disparity, the snapshot, tag, forget capabilities cannot find/select those snapshots because it interprets my list as two separate flags.

I’d ultimately like to add the individual tags and remove the erroneous double tag, but can’t as I can’t select the ~100 backups meeting this condition.

What can I do?

There is a related issue/pull request: https://github.com/restic/restic/pull/2690

Hi there,

Please ignore answer below, I missed the comma in the question :man_facepalming:

You can bulk-select the erroneous tag. Check the following example:

~> restic -r /tmp/zazzzz snapshots
enter password for repository:
repository 0dfac4aa opened successfully, password is correct
ID        Time                 Host        Tags        Paths
---------------------------------------------------------------------------------
da693e62  2020-09-28 20:53:19  innixos     test-tag-1  /home/gurkan/techerror.sql
8f1a7bf4  2020-09-28 20:53:25  innixos     test-tag-2  /home/gurkan/techerror.sql
92e759de  2020-09-28 20:53:29  innixos     test-tag-1  /home/gurkan/techerror.sql
---------------------------------------------------------------------------------
3 snapshots

~> restic -r /tmp/zazzzz tag --tag test-tag-1 --remove test-tag-1 --add test-tag-3
enter password for repository:
repository 0dfac4aa opened successfully, password is correct
create exclusive lock for repository
modified tags on 2 snapshots

~> restic -r /tmp/zazzzz snapshots
enter password for repository:
repository 0dfac4aa opened successfully, password is correct
ID        Time                 Host        Tags        Paths
---------------------------------------------------------------------------------
6d1a138c  2020-09-28 20:53:19  innixos     test-tag-3  /home/gurkan/techerror.sql
8f1a7bf4  2020-09-28 20:53:25  innixos     test-tag-2  /home/gurkan/techerror.sql
96d0cba8  2020-09-28 20:53:29  innixos     test-tag-3  /home/gurkan/techerror.sql
---------------------------------------------------------------------------------
3 snapshots

@Hookshot You can run restic snapshots --json --quiet | jq '.[] | select(contains({tags: ["test"]})) | .id' to get a list of snapshot ids with a certain tag (“test” in the example query). Then use restic tag --set cats --set dogs snapshotID [...] to correct the tags.

TIL --set :+1: Thanks!

Thank you, this has really helped me out of jam!