with-lock.rst.inc 820 B

1234567891011121314151617181920212223242526272829303132
  1. .. _borg_with-lock:
  2. borg with-lock
  3. --------------
  4. ::
  5. borg with-lock <options> REPOSITORY COMMAND ARGS
  6. positional arguments
  7. REPOSITORY
  8. repository to lock
  9. COMMAND
  10. command to run
  11. ARGS
  12. command arguments
  13. `Common options`_
  14. |
  15. Description
  16. ~~~~~~~~~~~
  17. This command runs a user-specified command while the repository lock is held.
  18. It will first try to acquire the lock (make sure that no other operation is
  19. running in the repo), then execute the given command as a subprocess and wait
  20. for its termination, release the lock and return the user command's return
  21. code as borg's return code.
  22. Note: if you copy a repository with the lock held, the lock will be present in
  23. the copy, obviously. Thus, before using borg on the copy, you need to
  24. use "borg break-lock" on it.