First of all, please note that you can use the
--dry-run option to the
restic forget command to test forget policies without actually forgetting any snapshots. This is probably a good idea to do now that you’re trying to establish your policies and thereby the corresponding commands to use.
Next, please check the forget options by running
restic help forget, you can also check: Removing backup snapshots — restic 0.12.1 documentation
So, if you want to apply different policies to different tags, you probably need to use the
--tag option with the tag you want to apply a policy to, so that you only apply the policy and forget snapshots that has this tag on them. Then you’d run one
forget command for each tag.
Once you have that baseline, it should just be a matter of adding the proper
--keep-* options for each of the tags you want. E.g. to keep a snapshot every four weeks back you add the
--keep-weekly 4 option, to keep a snapshot every month for two months back add
--keep-monthly 3, and so on. The
--dry-run will let you see which snapshots restic would forget and which ones it would keep. Just try it and see
So in summary, for each of your repositories, you would run one
forget command (with appropriate options) for each of the tags. So that would be 2 (repositories) * 4 (tags) = 8
forget commands. Note that after that you only need to run one
prune command per repository though.
Does that make sense?