Dory backup removal

Daily backups, even if incremental, can fill up your disk space pretty quickly. So I've added some functionality to Dory to remove old backups.

I wanted a way to keep a number of backups, with recent backups being closer together and past ones further apart. I've ended up using the reciprocal time-distance to each neighbour, multiplied by the square root of the age, as a 'redundancy score'. This way, if there are close neighbours (e.g. .two backups made on the same day) then one of them is likely to be deleted. Old backups are also more likely to be deleted.

$$s_{red,i} = c \cdot \sum_{j \ne i} \frac{\sqrt{t_i}}{| t_i - t_j |}$$

It works pretty well! In the attached image, you'll see that a fixed number of backups is kept (blue), with a larger number of recent ones, but also old ones. The redundancy scores are updated after each removal, which works much better and explains why it's not the lowest 5 points that remain.

It is part of the Dory repository. Just run the script with --help to see the options.

Redundancy score vs age for a number of (fake) backups.


No comments yet

You need to be logged in to comment.