Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/borg/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from .helpers import ChunkIteratorFileWrapper, open_item
from .helpers import Error, IntegrityError, set_ec, sig_int
from .platform import uid2user, user2uid, gid2group, group2gid, get_birthtime_ns
from .helpers import parse_timestamp, archive_ts_now, CompressionSpec
from .helpers import parse_timestamp, archive_ts_now
from .helpers import OutputTimestamp, format_timedelta, format_file_size, file_status, FileSize
from .helpers import ArchiveFormatter
from .helpers import safe_encode, make_path_safe, remove_surrogates, text_to_json, join_cmd, remove_dotdot_prefixes
Expand Down Expand Up @@ -2744,7 +2744,6 @@ def __init__(
exclude_if_present=None,
keep_exclude_tags=False,
chunker_params=None,
compression=None,
dry_run=False,
stats=False,
progress=False,
Expand All @@ -2771,7 +2770,6 @@ def __init__(
# invariant by default, like borg transfer does, see BORG_ASSERT_ID.
self.repo_objs.set_assert_id_place("rechunk")
self.chunker_params = chunker_params or CHUNKER_PARAMS
self.compression = compression or CompressionSpec("none")
self.seen_chunks = set()

self.timestamp = timestamp
Expand Down
14 changes: 12 additions & 2 deletions src/borg/archiver/recreate_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def do_recreate(self, args, repository, manifest, cache):
exclude_if_present=args.exclude_if_present,
keep_exclude_tags=args.keep_exclude_tags,
chunker_params=args.chunker_params,
compression=args.compression,
# args.compression is not passed here: the with_repository decorator has already
# set repo_objs.compressor from it, which compresses everything newly written.
progress=args.progress,
stats=args.stats,
file_status_printer=self.print_file_status,
Expand Down Expand Up @@ -79,6 +80,11 @@ def build_parser_recreate(self, subparsers, common_parser, mid_common_parser):
switch existing archives to different chunker parameters (or a different chunker
algorithm), so they deduplicate with archives created using these parameters.

``--compression`` only applies to data recreate newly writes, e.g. when re-chunking
with ``--chunker-params`` (and to the new archive metadata). Data chunks reused
as-is from the existing archive keep their current compression - to recompress
existing repository objects, use ``borg repo-compress``.

**USE WITH CAUTION.**
Depending on the paths and patterns given, recreate can be used to
delete files from archives permanently.
Expand Down Expand Up @@ -158,7 +164,11 @@ def build_parser_recreate(self, subparsers, common_parser, mid_common_parser):
type=CompressionSpec,
default=CompressionSpec("lz4"),
action=Highlander,
help="select compression algorithm, see the output of the " '"borg help compression" command for details.',
help="select compression algorithm, see the output of the "
'"borg help compression" command for details. '
"Only applies to newly written data, e.g. when re-chunking with --chunker-params "
"(and to the new archive metadata); data chunks reused from the existing archive "
"are not recompressed, use borg repo-compress for that.",
)
archive_group.add_argument(
"--chunker-params",
Expand Down
Loading