0
0
Fork 0
mirror of https://projects.torsion.org/witten/borgmatic.git synced 2025-03-15 04:34:52 +00:00
witten_borgmatic/borgmatic/actions/break_lock.py

33 lines
808 B
Python
Raw Permalink Normal View History

import logging
import borgmatic.borg.break_lock
import borgmatic.config.validate
logger = logging.getLogger(__name__)
def run_break_lock(
repository,
2023-07-09 06:14:30 +00:00
config,
local_borg_version,
break_lock_arguments,
global_arguments,
local_path,
remote_path,
):
'''
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')
borgmatic.borg.break_lock.break_lock(
repository['path'],
2023-07-09 06:14:30 +00:00
config,
local_borg_version,
global_arguments,
local_path=local_path,
remote_path=remote_path,
)