2023-01-26 07:31:07 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
import borgmatic.borg.break_lock
|
|
|
|
import borgmatic.config.validate
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
def run_break_lock(
|
2023-04-15 02:35:24 +00:00
|
|
|
repository,
|
2023-07-09 06:14:30 +00:00
|
|
|
config,
|
2023-04-15 02:35:24 +00:00
|
|
|
local_borg_version,
|
|
|
|
break_lock_arguments,
|
2023-05-09 06:00:49 +00:00
|
|
|
global_arguments,
|
2023-04-15 02:35:24 +00:00
|
|
|
local_path,
|
|
|
|
remote_path,
|
2023-01-26 07:31:07 +00:00
|
|
|
):
|
|
|
|
'''
|
|
|
|
Run the "break-lock" action for the given repository.
|
|
|
|
'''
|
|
|
|
if break_lock_arguments.repository is None or borgmatic.config.validate.repositories_match(
|
|
|
|
repository, break_lock_arguments.repository
|
|
|
|
):
|
2025-01-25 22:14:48 +00:00
|
|
|
logger.info('Breaking repository and cache locks')
|
2023-01-26 07:31:07 +00:00
|
|
|
borgmatic.borg.break_lock.break_lock(
|
2023-03-24 19:34:57 +00:00
|
|
|
repository['path'],
|
2023-07-09 06:14:30 +00:00
|
|
|
config,
|
2023-03-24 19:34:57 +00:00
|
|
|
local_borg_version,
|
2023-05-09 06:00:49 +00:00
|
|
|
global_arguments,
|
2023-03-24 19:34:57 +00:00
|
|
|
local_path=local_path,
|
|
|
|
remote_path=remote_path,
|
2023-01-26 07:31:07 +00:00
|
|
|
)
|