Custom Backup Retention - Am I Understanding Correctly?

In case ts678’s responses don’t clarify it for you, here’s another way to describe what I think is your misunderstanding of what it’s actually doing.

Admittedly, I did not test any of this out, and if I’ve said something that contradicts what ts678 said, listen to ts678. :slight_smile:

Did you interpret 3M:1D,1M:1W,3Y:1M policy as:

  • For the last three months, keep one backup per day
  • For the whole month four months ago, keep one backup per week
  • For the 3 years going back before 4 months ago, keep one backup per month

Or using an example as if today were November 30th (for simplicity), did you expect:

  • For September, October and November, keep one backup per day
  • For August keep one backup per week
  • For August three years ago until July of this year, keep one backup per month
  • Anything older than August 3 years is deleted

For a total of (roughly) 90 days * 1 + ( 1 months * 30 days ) / 7 + 36 months * 1 = 130 total backups retained at any one time?

Note that Duplicati may treat “1 month” as “30 days”; not sure about that.

I don’t think the timeframes are additive like that. Meaning the 1M is not the month AFTER the 3M. The 1M is this past month, which the 3M includes. All the timeframes (values before the colon) start relative to “now” - the day that Duplicati is looking to thin the backups. So I think 3M:1D,1M:1W,3Y:1M is actually:

  • For the last 3 months, keep one backup per day
  • For the last month, keep one backup per week
  • For the last three years, keep one backup per month

The example of this (again, starting November 30th for simplicity), turns into:

  • For November, keep one backup per week
  • For September, October, November keep one backup per day (except that rule #1 already removed all but one backup from each week)
  • For November three years ago through August of this year, keep one backup per month
  • Anything older than 3 years ago is deleted

You’ll end up with: ( 4 months * 30 days ) / 7 + ( 36 - 4 ) months * 1 backups = 16 + 32 = 48 backups

I think the first rule would, essentially, be ignored because it’s superseded by the second rule. It would say “For the prior month I should keep one per week and delete all other backups from each week”, so at that point, saying “For the prior 3 months I should keep one per day” can’t actually be done since it was already thinned to one per week.

To get what you probably wanted out of 3M:1D,1M:1W,3Y:1M, I think you need: 3M:1D, 4M:1W, 3Y:1M. This means:

  • For the last 3 months, keep one backup per day
  • For the last 4 months, essentially ignoring the last 3 months because they’re covered by the first rule, keep one backup per week.
  • For the last 3 years, ignoring the last 4 months, keep one backup per month
  • Anything older than 3 years ago is deleted

Going to my trusty example, if today were November 30th this would mean:

  • For September, October and November, keep one backup per day
  • For August, keep one backup per week
  • Starting November 3 years ago, through July of this year, keep one backup per month
  • Anything older than 3 years ago is deleted

Switching to 3M:0s,1M:1W,3Y:1M gets you, essentially, the same as 3M:1D,1M:1W,3Y:1M because the first rule is still superseded by the second rule. You’ll still keep, at most, one backup per week.

Hopefully this is not more confusing (and I really hope my interpretation is correct!)

Regards
L

1 Like