How to exclude a particular snapshot from tag based forget/prune policy

I’ve been using restic for a month with GREAT SUCCESS. Many Thanks.

As part of my snapshots I give each one a tag of ‘Main’. My Forget/Prune policy says that keep the last 30 tags of ‘Main’. I do nightly backups. I have recently identified a particular snapshot that I would like to exclude from the Forget/Prune 30 day policy.

To avoid deleting that snapshot I have temporarily suspended my Forget/Prune runs. I would like to know how I can move that one snapshot out of the way.

One thought that I had would be to either change or add another tag to that particular snapshot. That would then fall outside the policy and be kept.

Is there a way of adding or amending a tag for a particular snapshot?

Thanks in advance

Sure, just use the tag command to add a tag to that snapshot, and then --keep-tag snapshots with that tag. See restic help tag for more information.

2 Likes

Thanks very much. Should have done more research. Apologies.

Is --keep-tag case sensitive?

Yes. Adding tags foo and FOO to a snapshot adds two tags, whereas trying to add tag foo twice to the same snapshot does not change anything since the tag is already there.

1 Like