DOKK / manpages / debian 12 / borgbackup-is-borgbackup2 / borg-compact.1.en
BORG-COMPACT(1) borg backup tool BORG-COMPACT(1)

borg-compact - compact segment files in the repository

borg [common options] compact [options]

This command frees repository space by compacting segments.

Use this regularly to avoid running out of space - you do not need to use this after each borg command though. It is especially useful after deleting archives, because only compaction will really free repository space.

borg compact does not need a key, so it is possible to invoke it from the client or also from the server.

Depending on the amount of segments that need compaction, it may take a while, so consider using the --progress option.

A segment is compacted if the amount of saved space is above the percentage value given by the --threshold option. If omitted, a threshold of 10% is used. When using --verbose, borg will output an estimate of the freed space.

See separate_compaction in Additional Notes for more details.

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

set minimum threshold for saved space in PERCENT (Default: 10)

# compact segments and free repo disk space
$ borg compact


borg-common(1)

The Borg Collective

2023-03-01