Allow limiting space to use it more intelligently
My online storage has a quota. Of course I want to retain as many snapshots as the quota allows. Desired: Rustic prunes and makes new snapshots automatically based on the space remaining (lest manoeuvring itself into a spaceless condition where default pruning is impossible). Solution: Add config switch that specifies quota of storage. Then extend rustic to guesstimate or determine whether next snapshot fits into remaining space. If not, let it decide based on retaining strategy which old snapshot to delete.
Problem is, rustic isn't great at realising when it's running out of space (at least for hetzner's storage box).
When rustic has run out of space, rustic prune is exacerbating the problem by consuming even more space.
For the initiated rustic prune --instant-delete does reduce space consumption by deleting snapshots immediately.
Hi @benjaminweb, thanks for opening this issue!
I can understand your desire, but I must say there are some major difficulties here:
- by design, the
backupcommand is designed to not remove or alter any existing file in the repository (it is append-only). IMO this is a huge feature of rustic as backup-tool and wouldn't want to change this. So, only solutions involving two or more steps would come into my mind. - Due to the deduplication and compression, it is not possible to predict how much space some new snapshots can add to the repository - unless doing basically all the work and just skip saving the files to the repository (which e.g. the
dry-runoption does). So, limiting space forbackupwould either involve a costly dry-run or abort with an incomplete backup.