borg [common options] repo-compress [options]
options |
||
|
select compression algorithm, see the output of the “borg help compression” command for details. Default: the repository default (see borg repo-create), else lz4. |
|
|
print statistics |
|
Repository (re-)compression (and/or re-obfuscation).
Reads all repository objects and recompresses the ones that are not already using
the compression type/level and obfuscation level given via --compression. Without
--compression, that is the repository’s default compression (see borg repo-create),
else lz4.
The repository is processed one pack file at a time: a pack is read as a whole and, if it holds objects that need recompression, rewritten as a whole - objects already using the desired compression are copied into the rewritten pack unchanged. A pack whose objects all already use the desired compression is not touched at all. 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.
borg repo-compress does not rewrite packs that borg check recorded as corrupt
and 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).
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.
This command needs free space in the repository for the rewritten pack files (roughly one pack file size while running).
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.
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.
# Recompress repository contents
$ borg repo-compress --progress --compression=zstd,3
# Recompress and obfuscate repository contents
$ borg repo-compress --progress --compression=obfuscate,1,zstd,3