diff --git a/borgmatic/commands/borgmatic.py b/borgmatic/commands/borgmatic.py index 255ee833..2af16143 100644 --- a/borgmatic/commands/borgmatic.py +++ b/borgmatic/commands/borgmatic.py @@ -62,6 +62,10 @@ def run_configuration(config_filename, config, arguments): prune_create_or_check = {'prune', 'create', 'check'}.intersection(arguments) monitoring_log_level = verbosity_to_log_level(global_arguments.monitoring_verbosity) + hook_context = { + 'repository': ','.join(location['repositories']), + } + try: if prune_create_or_check: dispatch.call_hooks( @@ -79,6 +83,7 @@ def run_configuration(config_filename, config, arguments): config_filename, 'pre-prune', global_arguments.dry_run, + **hook_context, ) if 'create' in arguments: command.execute_hook( @@ -87,6 +92,7 @@ def run_configuration(config_filename, config, arguments): config_filename, 'pre-backup', global_arguments.dry_run, + **hook_context, ) if 'check' in arguments: command.execute_hook( @@ -95,6 +101,7 @@ def run_configuration(config_filename, config, arguments): config_filename, 'pre-check', global_arguments.dry_run, + **hook_context, ) if 'extract' in arguments: command.execute_hook( @@ -103,6 +110,7 @@ def run_configuration(config_filename, config, arguments): config_filename, 'pre-extract', global_arguments.dry_run, + **hook_context, ) if prune_create_or_check: dispatch.call_hooks( @@ -168,6 +176,7 @@ def run_configuration(config_filename, config, arguments): config_filename, 'post-prune', global_arguments.dry_run, + **hook_context, ) if 'create' in arguments: dispatch.call_hooks( @@ -184,6 +193,7 @@ def run_configuration(config_filename, config, arguments): config_filename, 'post-backup', global_arguments.dry_run, + **hook_context, ) if 'check' in arguments: command.execute_hook( @@ -192,6 +202,7 @@ def run_configuration(config_filename, config, arguments): config_filename, 'post-check', global_arguments.dry_run, + **hook_context, ) if 'extract' in arguments: command.execute_hook( @@ -200,6 +211,7 @@ def run_configuration(config_filename, config, arguments): config_filename, 'post-extract', global_arguments.dry_run, + **hook_context, ) if prune_create_or_check: dispatch.call_hooks(