compact.rst.inc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_compact:
  3. borg compact
  4. ------------
  5. .. code-block:: none
  6. borg [common options] compact [options]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+
  10. | .. class:: borg-common-opt-ref |
  11. | |
  12. | :ref:`common_options` |
  13. +-------------------------------------------------------+
  14. .. raw:: html
  15. <script type='text/javascript'>
  16. $(document).ready(function () {
  17. $('.borg-options-table colgroup').remove();
  18. })
  19. </script>
  20. .. only:: latex
  21. :ref:`common_options`
  22. |
  23. Description
  24. ~~~~~~~~~~~
  25. Free repository space by deleting unused chunks.
  26. borg compact analyzes all existing archives to find out which repository
  27. objects are actually used (referenced). It then deletes all unused objects
  28. from the repository to free space.
  29. Unused objects may result from:
  30. - borg delete or prune usage
  31. - interrupted backups (maybe retry the backup first before running compact)
  32. - backup of source files that had an I/O error in the middle of their contents
  33. and that were skipped due to this
  34. - corruption of the repository (e.g. the archives directory having lost
  35. entries, see notes below)
  36. You usually don't want to run ``borg compact`` after every write operation, but
  37. either regularly (e.g. once a month, possibly together with ``borg check``) or
  38. when disk space needs to be freed.
  39. **Important:**
  40. After compacting it is no longer possible to use ``borg undelete`` to recover
  41. previously soft-deleted archives.
  42. ``borg compact`` might also delete data from archives that were "lost" due to
  43. archives directory corruption. Such archives could potentially be restored with
  44. ``borg check --find-lost-archives [--repair]``, which is slow. You therefore
  45. might not want to do that unless there are signs of lost archives (e.g. when
  46. seeing fatal errors when creating backups or when archives are missing in
  47. ``borg repo-list``).