Retention - keep first backup

I’m a new user of Kopia, but i’m trying to understand the retention rules.
I feel that I already understand the system, but I have a question:
Which settings i’ve to use to keep my FIRST backup for several years? but doing the normal deletion of the snapshots

thanks

Such thing is not currently (directly) supported. Should be quite easy to add.

Currently Kopia always chooses the last snapshot of the period, e.g. if I run a daily backup, my “annual” snapshot will be the last snapshot of the year (31.12.20XX).
A good solution is to allow for each period (week, month, etc.) the label to be assigned to the “first” or “last” snapshot.
E.g. for a daily backup with the label “annual” set to “first”, the backup chosen is the one of 01.01.20XX
This solution solves 2 problems:
-keeping the first backup
-it is also better to have a backup of 01.01.20XX(with full previous year) than one from 31.12.20XX (that doesn’t have all year…)

So if you add this settings for each period (day, week, month…) the retention system improves a lot.

(sorry for any possible error… since I am really new at this)

I too am struggling with understanding the retention rules and the defaults.

I am planning to do nightly backups but none of my backups have any tag or identification that they are ‘daily’ or anything else. So how does the system know how long to keep them?

Don’t set any of the retention options to 0. If you don’t want them to apply, just leave them empty.

@budy thanks for your input but I am not understanding kopia’s retention scheme. I am taking nightly backups and have left default global policy. On that basis when would I expect to see a snapshot being removed and which snapshot would be removed?

This seems more like a philosophical issue to me. What is captured in a snapshot isn’t depending on what has been captured in any other snapshot. If you have a snapshot on 01.01.2021 you will have all the files available from that point in time. If you create and delete files between this snapshot and any other snapshot, these files won’t be in the new snapshot. A snapshot doesn’t span any amount of time.

To me, it is really not important, if the first snapshot gets removed down the line, as this is not, what a backup is meant to do. You might want to think about an archive, instead of a backup.

Also the label “first” imposes some issues… if you chose to assign the label for a specific retension class to the first occurence of a snapshot in that class, how would you manage to keep the latest then? Also, on the first snapshot, all the labels which are set to be applied to the first occurrence would all reference the same snapshot…

I think, it would make sense, to have a snapshot have an attribute “lock” which you could manually set and thus keep that particular snapshot from being removed by the automatic housekeeper jobs.

If you’re dealing with a database dump, this is NOT a philosophical issue (imagine a subscription service that renews on the 1st of every month).
The “first” order is mainly for “weekly”, “monthly” and “annual” retention, so there is really no conflict.

I agree, but this is a different topic, not related to the order (first/last) of snapshots.

I don’t know, why you 're ripping out my comment from its context, since I never said, that dealing with database dumps - or any other files in this regard, is a philosophical issue. I was specifically referring to the statement that an backup on 01.01.20xx would be better than on 31.12.20xx, because the backup from 01.01.20xx would “have the previous year”, which simply isn’t true. It only holds the file which where there at that time.

If you created TBs of files and deleted them again before the next annually snapshot, they would not be in the snapshot on 01.01. the following year. There’s never a one-size-fits-all solution when it comes to backups and if you’re in need of more snapshots to be able to grab older versions, then probably using different snapshots with different retension policies would give you that. You could set a high number of daily snapshots to keep - 3650 to cover 10 years and have each snapshot be preserved.

1 Like