From 7cd048f53ad93023121d626d5ccb442a9e323129 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 5 Nov 2024 21:25:24 +0100 Subject: [PATCH] compact: explain more --- src/borg/archiver/compact_cmd.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/borg/archiver/compact_cmd.py b/src/borg/archiver/compact_cmd.py index 067a099c4..310296fdb 100644 --- a/src/borg/archiver/compact_cmd.py +++ b/src/borg/archiver/compact_cmd.py @@ -185,9 +185,23 @@ class CompactMixIn: - interrupted backups (maybe retry the backup first before running compact!) - backup of source files that had an I/O error in the middle of their contents and that were skipped due to this. + - corruption of the repository (e.g. the archives directory having lost entries) - Important: after compacting it is not possible anymore to use ``borg undelete`` - to recover previously deleted archives. + You usually don't want to run ``borg compact`` after every write operation, but + either regularly (e.g. once a month, possibly together with ``borg check``) or + when disk space needs to be freed. + + **Important:** + + After compacting it is not possible anymore to use ``borg undelete`` to recover + previously deleted archives. + + ``borg compact`` might also delete data from archives that were "lost" due to + archives directory corruption. Such archives could potentially be restored with + ``borg check --find-lost-archives [--repair]``, which is slow and thus you + maybe usually don't want to do that 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.