break_lock.py 817 B

123456789101112131415161718192021222324252627282930313233
  1. import logging
  2. import borgmatic.borg.break_lock
  3. import borgmatic.config.validate
  4. logger = logging.getLogger(__name__)
  5. def run_break_lock(
  6. repository,
  7. config,
  8. local_borg_version,
  9. break_lock_arguments,
  10. global_arguments,
  11. local_path,
  12. remote_path,
  13. ):
  14. '''
  15. Run the "break-lock" action for the given repository.
  16. '''
  17. if break_lock_arguments.repository is None or borgmatic.config.validate.repositories_match(
  18. repository,
  19. break_lock_arguments.repository,
  20. ):
  21. logger.info('Breaking repository and cache locks')
  22. borgmatic.borg.break_lock.break_lock(
  23. repository['path'],
  24. config,
  25. local_borg_version,
  26. global_arguments,
  27. local_path=local_path,
  28. remote_path=remote_path,
  29. )