borg-repo-compress(1)
π borg-repo-compress(1) β the borg backup tool's "glow up ur repo" era β¨
okay bestie, welcome to borg-repo-compress π
this is the page where your repository gets a whole new lewk. it lives in the borg backup tool family, obvi.
πΈ Name πΈ
borg-repo-compress β Repository (re-)compression. like, giving ur chunks a makeover. periodt.
π SYNOPSIS π
borg [common options] repo-compress [options]
π¦ DESCRIPTION π¦
Repository (re-)compression (and/or re-obfuscation). yes queen, both at once if u want.
So here's the vibe: it reads all repository objects and recompresses the ones that are not already using the compression type/level and obfuscation level given via --compression. and if u don't pass --compression at all? then it uses the repository's default compression (see borg repo-create), else lz4. that's just how it is, no cap.
The repository is processed one pack file at a time β a pack gets read as a whole, and if it holds objects that need recompression, it gets rewritten as a whole. objects that already use the desired compression are copied into the rewritten pack unchanged, so no unnecessary drama. and a pack whose objects all already use the desired compression? not touched at all. it's giving "if it's not broke don't fix it" β¨
please note that the outcome of recompressing a chunk might not always be the desired compression type/level β if no compression gives a shorter output, that might be chosen; such chunks are kept as they are. lowkey it's doing its best, ok?? π
borg repo-compress does not rewrite packs that borg check recorded as corrupt, and it warns about them. borg check --repair --verify-data deletes the corrupt chunks by rewriting their packs. It does not remove damage outside any chunk (e.g. bytes appended to a pack): a pack with such damage and no corrupt chunk stays recorded corrupt and is not rewritten, a pack that also has a corrupt chunk is rewritten with that damage copied into the new pack (refs #10026). like, we are NOT the cleanup crew for everything, that's above our pay grade bestie π
Rewriting a pack invalidates every client's cached chunk index, so the next borg operation of each client will re-fetch the chunk index from the repository. just letting u know so ur not confused later π
This command needs free space in the repository for the rewritten pack files (roughly one pack file size while running). so check ur disk before u get too ambitious π
If the borg repo-compress process receives a SIGINT signal (Ctrl+C), it stops at the next pack boundary, leaving the repository and its chunk index in a consistent state; running it again later processes the remaining packs. iconic behavior honestly, it cleans up after itself π
Both --progress and --stats are recommended when borg repo-compress is used interactively. fr fr, u wanna watch the numbers go brrr π
You do not need to run borg compact after borg repo-compress. best news u'll hear all day π
β¨ OPTIONS β¨
See borg-common(1) for common options of Borg commands.
π options π
-C COMPRESSION,--compression COMPRESSIONβ select compression algorithm, see the output of theborg help compressioncommand for details. Default: the repository default (seeborg repo-create), elselz4.-s,--statsβ print statistics. the receipts, bestie π§Ύ
π EXAMPLES π
# Recompress repository contents
$ borg repo-compress --progress --compression=zstd,3
# Recompress and obfuscate repository contents
$ borg repo-compress --progress --compression=obfuscate,1,zstd,3
π«Ά SEE ALSO π«Ά
π Author π
The Borg Collective. the whole squad, together π
and that's a wrap bestie!! this page came from the borg backup tool, dated 2026-10-07 β keep slaying out there, and remember: ur repo deserves the glow up π β¨π¦
π¦ where this page comes from
- ubuntu stonking: borgbackup2 2.0.0b25-4 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms