---
name: "borg2-repo-compress"
section: "1"
platform: "linux"
package: "borgbackup2"
version: "2.0.0b19-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/borg2-repo-compress"
---

# borg2-repo-compress(1)

Repository (re-)compression

## NAME

borg-repo-compress - Repository (re-)compression

## SYNOPSIS

borg \[common options\] repo-compress \[options\]

## DESCRIPTION

Repository (re-)compression (and/or re-obfuscation).

Reads all chunks in the repository and recompresses them if they are not already using the compression type/level and obfuscation level given via **--compression**.

If the outcome of the chunk processing indicates a change in compression type/level or obfuscation level, the processed chunk is written to the repository. Please note that the outcome might not always be the desired compression type/level - if no compression gives a shorter output, that might be chosen.

Please note that this command can not work in low (or zero) free disk space conditions.

If the **borg repo-compress** process receives a SIGINT signal (Ctrl-C), the repo will be committed and compacted and borg will terminate cleanly afterwards.

Both **--progress** and **--stats** are recommended when **borg repo-compress** is used interactively.

You do **not** need to run **borg compact** after **borg repo-compress**.

## OPTIONS

See *[borg-common(1)](/borg-common/1.md)* for common options of Borg commands.

### options

- **-C** *COMPRESSION,* **--compression** *COMPRESSION*

  select compression algorithm, see the output of the "borg help compression" command for details.

- **-s, --stats**

  print statistics

## EXAMPLES

```
# recompress repo contents
$ borg repo-compress --progress --compression=zstd,3
# recompress and obfuscate repo contents
$ borg repo-compress --progress --compression=obfuscate,1,zstd,3
```

## SEE ALSO

*[borg-common(1)](/borg-common/1.md)*

## AUTHOR

The Borg Collective
