with-lock.rst.inc 2.3 KB

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