compact.rst.inc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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] [REPOSITORY]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
  12. | | ``REPOSITORY`` | repository to compact |
  13. +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
  14. | **options** |
  15. +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
  16. | | ``-n``, ``--dry-run`` | do nothing |
  17. +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
  18. | | ``--cleanup-commits`` | cleanup commit-only 17-byte segment files |
  19. +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
  20. | | ``--threshold PERCENT`` | set minimum threshold for saved space in PERCENT (Default: 10) |
  21. +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
  22. | .. class:: borg-common-opt-ref |
  23. | |
  24. | :ref:`common_options` |
  25. +-------------------------------------------------------+-------------------------+----------------------------------------------------------------+
  26. .. raw:: html
  27. <script type='text/javascript'>
  28. $(document).ready(function () {
  29. $('.borg-options-table colgroup').remove();
  30. })
  31. </script>
  32. .. only:: latex
  33. REPOSITORY
  34. repository to compact
  35. options
  36. -n, --dry-run do nothing
  37. --cleanup-commits cleanup commit-only 17-byte segment files
  38. --threshold PERCENT set minimum threshold for saved space in PERCENT (Default: 10)
  39. :ref:`common_options`
  40. |
  41. Description
  42. ~~~~~~~~~~~
  43. This command frees repository space by compacting segments.
  44. Use this regularly to avoid running out of space - you do not need to use this
  45. after each borg command though. It is especially useful after deleting archives,
  46. because only compaction will really free repository space.
  47. borg compact does not need a key, so it is possible to invoke it from the
  48. client or also from the server.
  49. Depending on the amount of segments that need compaction, it may take a while,
  50. so consider using the ``--progress`` option.
  51. A segment is compacted if the amount of saved space is above the percentage value
  52. given by the ``--threshold`` option. If omitted, a threshold of 10% is used.
  53. When using ``--verbose``, borg will output an estimate of the freed space.
  54. For maximum compaction, use ``--threshold 0``. This will compact whenever any
  55. space can be saved and thus rewrites the most data; it can be much slower on
  56. large repositories. Using ``--threshold 1`` usually achieves nearly the same
  57. result significantly faster. Higher thresholds (e.g. the default 10) trade
  58. compaction thoroughness for speed. Note: ``--threshold 100`` will effectively
  59. compact nothing.
  60. After upgrading borg (server) to 1.2+, you can use ``borg compact --cleanup-commits``
  61. to clean up the numerous 17-byte commit-only segments that borg 1.1 did not clean up
  62. due to a bug. It is enough to do that once per repository. After cleaning up the
  63. commits, borg will also do a normal compaction.
  64. See :ref:`separate_compaction` in Additional Notes for more details.