with-lock.rst.inc 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_with-lock:
  3. borg with-lock
  4. --------------
  5. .. code-block:: none
  6. borg [common options] with-lock [options] REPOSITORY COMMAND [ARGS...]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+----------------+--------------------+
  10. | **positional arguments** |
  11. +-------------------------------------------------------+----------------+--------------------+
  12. | | ``REPOSITORY`` | repository to lock |
  13. +-------------------------------------------------------+----------------+--------------------+
  14. | | ``COMMAND`` | command to run |
  15. +-------------------------------------------------------+----------------+--------------------+
  16. | | ``ARGS`` | command arguments |
  17. +-------------------------------------------------------+----------------+--------------------+
  18. | .. class:: borg-common-opt-ref |
  19. | |
  20. | :ref:`common_options` |
  21. +-------------------------------------------------------+----------------+--------------------+
  22. .. raw:: html
  23. <script type='text/javascript'>
  24. $(document).ready(function () {
  25. $('.borg-options-table colgroup').remove();
  26. })
  27. </script>
  28. .. only:: latex
  29. REPOSITORY
  30. repository to lock
  31. COMMAND
  32. command to run
  33. ARGS
  34. command arguments
  35. :ref:`common_options`
  36. |
  37. Description
  38. ~~~~~~~~~~~
  39. This command runs a user-specified command while the repository lock is held.
  40. It will first try to acquire the lock (make sure that no other operation is
  41. running in the repo), then execute the given command as a subprocess and wait
  42. for its termination, release the lock and return the user command's return
  43. code as borg's return code.
  44. .. note::
  45. If you copy a repository with the lock held, the lock will be present in
  46. the copy. Thus, before using borg on the copy from a different host,
  47. you need to use "borg break-lock" on the copied repository, because
  48. Borg is cautious and does not automatically remove stale locks made by a different host.