borg-with-lock.1 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "BORG-WITH-LOCK" "1" "2025-12-23" "" "borg backup tool"
  31. .SH NAME
  32. borg-with-lock \- Runs a user-specified command with the repository lock held.
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] with\-lock [options] COMMAND [ARGS...]
  36. .SH DESCRIPTION
  37. .sp
  38. This command runs a user\-specified command while locking the repository. For example:
  39. .INDENT 0.0
  40. .INDENT 3.5
  41. .sp
  42. .EX
  43. $ BORG_REPO=/mnt/borgrepo borg with\-lock rsync \-av /mnt/borgrepo /somewhere/else/borgrepo
  44. .EE
  45. .UNINDENT
  46. .UNINDENT
  47. .sp
  48. It first tries to acquire the lock (make sure that no other operation is
  49. running in the repository), then executes the given command as a subprocess and waits
  50. for its termination, releases the lock, and returns the user command\(aqs return
  51. code as Borg\(aqs return code.
  52. .sp
  53. \fBNOTE:\fP
  54. .INDENT 0.0
  55. .INDENT 3.5
  56. If you copy a repository with the lock held, the lock will be present in
  57. the copy. Before using Borg on the copy from a different host,
  58. you need to run \fBborg break\-lock\fP on the copied repository, because
  59. Borg is cautious and does not automatically remove stale locks made by a different host.
  60. .UNINDENT
  61. .UNINDENT
  62. .SH OPTIONS
  63. .sp
  64. See \fIborg\-common(1)\fP for common options of Borg commands.
  65. .SS arguments
  66. .INDENT 0.0
  67. .TP
  68. .B COMMAND
  69. command to run
  70. .TP
  71. .B ARGS
  72. command arguments
  73. .UNINDENT
  74. .SH SEE ALSO
  75. .sp
  76. \fIborg\-common(1)\fP
  77. .SH AUTHOR
  78. The Borg Collective
  79. .\" Generated by docutils manpage writer.
  80. .