btrbk icon indicating copy to clipboard operation
btrbk copied to clipboard

De-duplicate *_preserve and *_preseve_min

Open bdaase opened this issue 3 years ago • 2 comments

I had quite a hard time understanding the difference between the *_preserve and *_preseve_min config options after misunderstanding them in the beginning.

After reading them in more detail now, I don't understand why this differentiation even exists. AFAICS, by just always having one of them and allowing the values all|latest|no|<retention_policy>, all use cases covered at the moment would then be achievable as well. As a result, configuration would be much easier and less error-prone.

bdaase avatar Jan 08 '22 21:01 bdaase

Sorry for the late reply, I kind of missed that one.

The difference is that one defines a duration in which to keep all backups (e.g. if you run btrbk manually, you might want to keep all those backups for a certain amount of time), and the other defines a point in time for which the backups should be preserved (e.g. one backup per week).

From the man-page:

Retention policies are defined individually for snapshots,
backups and archives (summarized as "backups" in the following
text), using a combination of:

*_preserve_min all|latest|no|<number>{h,d,w,m,y}
    Amount of time (duration) in which all backups are preserved.

*_preserve no|<retention_policy>
    Schedule (single points in time) for which individual backups are preserved.

digint avatar Feb 27 '22 10:02 digint

After at least a year of using btrbk, I've only just noticed the (duration) versus (single points in time) distinction, i.e. the latter involves a set of snapshot types (daily, weekly, etc.) with a retention COUNT for each - meaning that pruning is often discontiguous in what it deletes - whereas the former is just a contiguous timespan from now()-span .. now() in which to delete all snapshots. Could that be clarified in the documentation? I can submit a PR if you like.

luxagen avatar Apr 20 '22 13:04 luxagen