Backup pruning should be smarter #7
Comments
|
I would certainly appreciate an option to have a prune-selection-hook of some kind that would allow me to produce an arbitrary pruning policy. Also it would be nice to be able to specify pruning policies per device; e.g. I currently have one device that I keep locally at all times for easy correction of user/sysadmin errors and minor problems and a number of devices that I cycle around through an offsite cycle. The former could optimally do with a fairly long period (say a month) of daily (or more frequent!) backups kept and then very fast tail-off, maybe not keeping anything older than 6 months; whereas the offsites probably want fewer daily backups but then a much slower tail-off; having to go to an offsite to get a year old file back isn't likely to be an issue! |
|
Additionally the current behaviour has the effect that when an offsite returns to being onsite it generally gets pruned down to "min-backups" quantity immediately because everything is older than prune-age. I can't quite put a rational explanation on why this behaviour feels wrong; but it does. |
|
I was thinking of something along these lines:
The existing pruning configuration would be re-expressed as one possible policy and set of parameters. One or more policies would be built in. A policy name starting |
|
That design appears to suit my requirements, |
|
https://github.com/ewxrjk/rsbackup/tree/pruning-7 contains a just-written implementation. The degree of testing can be seen in the new test scripts.
Feedback welcome. |
|
The same branch has evolved a bit:
I consider this basically done, but feedback is still welcome. |
Currently pruning involves removing the largest contiguous chunk of backups, starting at the oldest, which is consistent with the
prune-ageandmin-backupsconstraints.This doesn't make for very good use of storage space. An alternative policy would be to thin out backups non-contiguously. For instance the last week could keep daily backups, the rest of the last month could keep weekly backups and the rest of the last year could keep monthly backups.
More generally, an interface could be defined for operators to select completely arbitrary pruning policies.
The text was updated successfully, but these errors were encountered: