Apologies for another post on forget policies. I’ve searched the way to delete all snapshots, that older than defined date. As I see from documentation, all --keep-XXX option save most recent snapshots (each defined date period for --keep-XXX or within the specified duration of the latest snapshot for --keep-within).
I have mono repository (I known t’s not best choice, but it happened for history reason), that have some group of snapshots, which is now not backuped. For example:
restic -r /mnt/repo forget --keep-daily 30 --keep-weekly 12 --keep-yearly 5 --prune --dry-run
Applying Policy: keep 30 daily, 12 weekly, 5 yearly snapshots
keep 39 snapshots:
ID Time Host Tags Reasons Paths
dacde85c 2021-06-02 04:11:19 host mysql yearly snapshot /spamassassin.sql
…
remove 330 snapshots:
ID Time Host Tags Paths
7e0fb0ad 2021-06-03 04:11:20 host mysql /spamassassin.sql
…
keep 38 snapshots:
ID Time Host Tags Reasons Paths
f4936dc7 2023-11-14 04:26:08 host mysql yearly snapshot /baikal.sql
…
remove 39 snapshots:
ID Time Host Tags Paths
5a065ec8 2023-11-15 04:26:18 host mysql /baikal.sql
Is there a way to apple some if-exist logic for --keep options, that save snapshots, which correspond to --keep rules, and remove all snapshots, that are older than defined date?