borg-with-lock.1 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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-04-18" "" "borg backup tool"
  31. .SH NAME
  32. borg-with-lock \- run a user specified command with the repository lock held
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] with\-lock [options] REPOSITORY 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 with\-lock /mnt/borgrepo rsync \-av /mnt/borgrepo /somewhere/else/borgrepo
  44. .EE
  45. .UNINDENT
  46. .UNINDENT
  47. .sp
  48. It will first try to acquire the lock (make sure that no other operation is
  49. running in the repo), then execute the given command as a subprocess and wait
  50. for its termination, release the lock and return 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. Thus, before using borg on the copy from a different host,
  58. you need to use \(dqborg break\-lock\(dq 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 REPOSITORY
  69. repository to lock
  70. .TP
  71. .B COMMAND
  72. command to run
  73. .TP
  74. .B ARGS
  75. command arguments
  76. .UNINDENT
  77. .SH SEE ALSO
  78. .sp
  79. \fIborg\-common(1)\fP
  80. .SH AUTHOR
  81. The Borg Collective
  82. .\" Generated by docutils manpage writer.
  83. .