rustic
rustic copied to clipboard
Make prune really incremental
The prune
command currently already loops over index files and processes the contained pack files by either keeping them, repacking them, marking/unmarking them for deletion or putting them on a list of files-to-be-removed. The actual removal of pack files and the now-unneeded index files is then done at the very end.
This process can be improved in two ways:
- When an index file is completely processed (all packs-to repack are repacked and all index entries are saved + the corresponding files have been submitted to the backend) we could remove the index file and the pack files to remove before continuing to process other index files. This would be an true incremental pruning which would no longer need uneccessary large "scratch" space.
- The index files are processed in arbitrary order so far. They could be sorted to first process index files which will result in removing packs and not repacking anything and process the index files last which will result in not removing anything but doing heavy repacking.