From a1d2f7f2218f2bc44dcc147957c89f6844a9eaa8 Mon Sep 17 00:00:00 2001 From: Vandal <86826719+VandalByte@users.noreply.github.com> Date: Mon, 24 Mar 2025 11:51:33 +0530 Subject: [PATCH] add path --- borgmatic/borg/recreate.py | 4 ++++ borgmatic/commands/arguments.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/borgmatic/borg/recreate.py b/borgmatic/borg/recreate.py index a1bd60aa..fd547e2f 100644 --- a/borgmatic/borg/recreate.py +++ b/borgmatic/borg/recreate.py @@ -30,11 +30,15 @@ def recreate_archive( repo_archive_arg = make_repository_archive_flags(repository, archive, local_borg_version) exclude_flags = make_exclude_flags(config) + # handle path from recreate_arguments + path_flag = ('--path', recreate_arguments.path) if recreate_arguments.path else () + recreate_cmd = ( (local_path, 'recreate') + (('--remote-path', remote_path) if remote_path else ()) + repo_archive_arg + + path_flag + (('--log-json',) if global_arguments.log_json else ()) + (('--lock-wait', str(lock_wait)) if lock_wait else ()) + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ()) diff --git a/borgmatic/commands/arguments.py b/borgmatic/commands/arguments.py index 4018547e..7e942c63 100644 --- a/borgmatic/commands/arguments.py +++ b/borgmatic/commands/arguments.py @@ -1562,6 +1562,13 @@ def make_parsers(): '--archive', help='Name of the archive to recreate', ) + recreate_group.add_argument( + '--path', + metavar='PATH', + dest='paths', + action='append', + help='Path to recreate the repository/archive', + ) recreate_group.add_argument( '-h', '--help', action='help', help='Show this help message and exit' )