Closed ThomasWaldmann closed 2 weeks ago
What do you think about also updating the compact
epilog to mention all the things users should know?
Free repository space by deleting unused chunks.
``borg compact`` iterates over all chunks of data the repo consists
of and checks whether they are used by any archive in the archives
directory. All chunks that aren't referenced by any archive are
then deleted from the filesystem to free disk space. This most
notably includes all archives that were previously internally
marked for deletion ("soft-deleted archives") by the delete and
prune commands. Running the compact command consequently also
impedes ``borg undelete`` from undeleting any soft-deleted
archives. ``borg compact`` also removes not needed junk data from
previous backups, e.g. data of aborted backups, files that had to
be skipped due to I/O errors and other issues that arised while
creating previous backups.
You usually don't want to run ``borg compact`` after every write
operation on the repository, but either regularly (e.g. once a
month, possibly together with ``borg check``) or when disk space
needs to be freed.
**Important:** ``borg compact`` doesn't just remove data from
intentionally deleted archives and junk data, but might in rare
cases also delete data from archives that weren't intentionally
deleted, but "lost" due to data corruption on a filesystem or
hardware level. Such archives could potentially be restored with
``borg check --find-lost-archives [--repair]``, but note that
finding such lost archives is a very time consuming task one
usually doesn't want to take unless there are signs of lost
archives (e.g. when seeing fatal errors when creating backups or
when archives are missing in ``borg list``).
Differently than borg 1.x, borg2's compact needs the borg key
if the repo is encrypted.
I thought about it:
I will remove all user docs of "soft-deleted" again from borg and only explain what's happening in borg undelete
and/or borg compact
command, where it is somehow relevant.
Mentioning it all over the place isn't necessarily helpful, explaining it everywhere makes the docs longer than necessary.
@PhrozenByte I did it a bit differently, but hopefully giving all the information that is useful to the user (and not just an implementation detail).
I suggest you apply all your suggestions in a separate PR. I already mentioned that applying suggestions via the github UI doesn't always work. Then it sometimes also causes black
to fail and in the end it is tedious to process here.
Codecov Report
Attention: Patch coverage is
83.08824%
with23 lines
in your changes missing coverage. Please review.Additional details and impacted files
```diff @@ Coverage Diff @@ ## master #8515 +/- ## ========================================== + Coverage 81.47% 81.75% +0.28% ========================================== Files 73 74 +1 Lines 13142 13240 +98 Branches 1927 1941 +14 ========================================== + Hits 10707 10824 +117 + Misses 1770 1753 -17 + Partials 665 663 -2 ```:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.