logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

borg-compact - Collect garbage in repository

Author

       The Borg Collective

                                                   2025-01-03                                    BORG-COMPACT(1)

Description

       Free repository space by deleting unused chunks.

       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 borgcompact after every write operation, but either regularly (e.g. once a
       month, possibly together with borgcheck) or when disk space needs to be freed.

       Important:

       After  compacting  it  is  no  longer  possible  to  use borgundelete to recover previously soft-deleted
       archives.

       borgcompact might also delete data from archives that were "lost" due to archives directory  corruption.
       Such  archives  could  potentially  be restored with borgcheck--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 borgrepo-list).

Examples

          # compact segments and free repo disk space
          $ borg compact

Name

       borg-compact - Collect garbage in repository

Options

       See borg-common(1) for common options of Borg commands.

See Also

borg-common(1)

Synopsis

       borg [common options] compact [options]

See Also