Restic should keep two yearly snapshots, meaning that I can go back for a longer period of time.
Therefore I have this policy:
restic forget --keep-daily 7 --keep-monthly 4 --keep-yearly 2 --keep-weekly 4 --prune
Backup begins in April 2021. This policy would remove the backup from april, because yearly snapshot is the oldest of the year 2021. If first backup was on or before 31.12.2020 then everything would be fine and it would work as desired. But what to do until then?
Below is an example. All snapshots that are due to remove could be removed except Snapshot 4d7b1636 from 22.4.2021.
It would work perfect if restic would have an option to have to also flag the first snapshot of a year as yearly snapshot, then only the number of yearly snapshots to keep must be increased.
What ideas do you have to do this with the given possibilities of keeping snapshots?
Applying Policy: keep 7 daily, 4 weekly, 4 monthly, 2 yearly snapshots
keep 7 snapshots:
ID Time Host Tags Reasons Paths
------------------------------------------------------------------------------
ac05f518 2021-09-21 15:33:56 systemfour daily snapshot /
monthly snapshot /boot
d55aae8d 2021-10-20 23:14:59 systemfour daily snapshot /
weekly snapshot /boot
monthly snapshot
0b3ff612 2021-12-06 14:18:51 systemfour daily snapshot /
weekly snapshot /boot
fec94056 2021-12-21 10:57:50 systemfour daily snapshot /
/boot
2f80bbbd 2021-12-22 18:12:56 systemfour daily snapshot /
/boot
d8c8de43 2021-12-26 00:00:03 systemfour daily snapshot /
weekly snapshot /boot
monthly snapshot
yearly snapshot
089e4b0e 2022-01-02 00:00:03 systemfour daily snapshot /
weekly snapshot /boot
monthly snapshot
yearly snapshot
------------------------------------------------------------------------------
7 snapshots
remove 6 snapshots:
ID Time Host Tags Paths
------------------------------------------------------------
4d7b1636 2021-04-22 00:30:46 systemfour /
/boot
feb37297 2021-05-21 17:20:52 systemfour /
/boot
59464c6b 2021-05-24 11:53:38 systemfour /
/boot
1e9bada5 2021-06-14 09:20:32 systemfour /
/boot
511acfa6 2021-06-26 12:06:02 systemfour /
/boot
c0bb9ed0 2021-12-22 00:10:16 systemfour /
/boot
------------------------------------------------------------