1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-03 13:45:31 +00:00
borg/docs/usage/compact.rst.inc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
2.1 KiB
PHP
Raw Normal View History

2018-07-12 20:00:19 +00:00
.. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
.. _borg_compact:
borg compact
------------
.. code-block:: none
2022-06-23 23:19:19 +00:00
borg [common options] compact [options]
2018-07-12 20:00:19 +00:00
.. only:: html
.. class:: borg-options-table
2024-09-07 20:31:48 +00:00
+-------------------------------------------------------+
| .. class:: borg-common-opt-ref |
| |
| :ref:`common_options` |
+-------------------------------------------------------+
2018-07-12 20:00:19 +00:00
.. raw:: html
<script type='text/javascript'>
$(document).ready(function () {
$('.borg-options-table colgroup').remove();
})
</script>
.. only:: latex
:ref:`common_options`
|
Description
~~~~~~~~~~~
2024-09-07 20:31:48 +00:00
Free repository space by deleting unused chunks.
2019-09-06 22:27:17 +00:00
2024-11-16 19:14:16 +00:00
borg compact analyzes all existing archives to find out which repository
objects are actually used (referenced). It then deletes all unused objects
from the repository to free space.
Unused objects may result from:
- borg delete or prune usage
- 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, see notes below)
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 no longer possible to use ``borg undelete`` to recover
previously soft-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. You therefore
might not 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 repo-list``).