I want a “smart rolling” retention policy that meets the following criteria:
First snapshot retained forever.
Retain more recent snapshots and fewer old snapshots.
The goal is to have an efficient backup that retains a history extending back to the first snapshot, but places more emphasis on recent snapshots. For example, if the first snapshot was ten months ago:
Snapshot 1: 10 months ago (First snapshot retained forever.)
Snapshot 2: Five months ago
Snapshot 3: 10 weeks ago
Snapshot 4: Five weeks ago
Snapshot 5: Two weeks ago
…
…
Snapshot 10: Most recent snapshot.
In 10 years the repository would look something like:
Snapshot 1: 10 years ago (First snapshot still retained.)
Snapshot 2: Five years ago
Snapshot 3: Two years ago
…
…
Snapshot 10: Most recent snapshot.
This example highlights 10 snapshots, but the policy can permit more snapshots to exist in the repository at any given time.
change the Snapshot retention Annual to 10, it will keep all the snapshots you mentioned above. I am not sure how to delete the ones you are not listed. but I guess you can use a script to list all snapshots and delete the ones you don’t want based on the time you specified. but why bother? just keep them there, Kopia will take care of them.
kopia the least retention period is 1 year (keep 1 yearly snapshot). You can set it to 999 and stop worrying that the oldest snapshot will be ever deleted. If you do not want to keep every yearly snapshot then as @Cliff_Z said you have to do this outside kopia. Either write a script or once a year delete things manually (it will be one snapshot to delete).
Also you can kopia snapshot pin any snapshot and kopia retention rules do not touch it. I think it is also possible via UI.
It would be nice to have a more efficient solution. For example, Synology backup has an option for a “smart” retention policy similar to the one proposed above that keeps a specified number of snapshots (256 by default) with a roughly logarithmic chronology between the first snapshot (retained forever) and the most recent snapshot.