Clarification on rotation/retention of backup

Hm, I’m not sure I can follow. You’re talking about c74a4169 which was made on 2018-09-16.

  • For September, there’s a newer snapshot that satisfies the monthly snapshot on 2018-09-30.
  • For October, the snapshot on 2018-10-15 satisfies the monthly snapshot.

Restic’s forget policies never talk about “oldest” snapshots, only “most recent” snapshots relative to a unit (day, month, year).

If you want, you can implement your own retention policies by parsing the output of restic snaphots --json with a script, and then passing the list of snapshots to remove to restic forget. :slight_smile:

It is necessary to understand my remark from the point of view of possible restorations and only as long as the programmed cycle of retention is not complete. I wish I could restore files up to 3 months back. I launched my first backup on 16/09, as long as we are not in November I do not have 3 months back possible. It’s normal I started 16/09. However today, I have not yet 3 months of possible return (normal) but I can not even go up until 16 but only until 23. It’s a shame.

I think you need to change the parameters passed to forget. For this requirement you have several options:

  • Use --keep-within 3m. This will keep all snapshots made in the three months prior to the latest snapshot, so it’ll start removing snapshots made in September only when it sees snapshots made in December.
  • Use --keep-daily 90, this will keep one snapshot per day for the last 90 days in which snapshots were made.

I hope this helps you to improve your retention policy.

Unfortunately, “retention policies” is a very complicated subject, and everybody has different needs. We implemented a generic way to specify a retention policy in restic, which may not match everyone’s needs. I still think we found the right balance between rule complexity and use case coverage.

My comment about implementing your own retention policy was not meant to be snarky/derogatory, but rather matter-of-fact. :slight_smile:

Yes, I understand and I do not want to upset everything, it was just a remark on the issue of retention to take into account or not :wink:

I took it like that, no problem :slight_smile: , but other considerations are also to take into account that influences my choices.

Thanks for your time.