borg-with-lock.1 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 "2024-03-29" "" "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. .nf
  43. .ft C
  44. $ borg with\-lock /mnt/borgrepo rsync \-av /mnt/borgrepo /somewhere/else/borgrepo
  45. .ft P
  46. .fi
  47. .UNINDENT
  48. .UNINDENT
  49. .sp
  50. It will first try to acquire the lock (make sure that no other operation is
  51. running in the repo), then execute the given command as a subprocess and wait
  52. for its termination, release the lock and return the user command\(aqs return
  53. code as borg\(aqs return code.
  54. .sp
  55. \fBNOTE:\fP
  56. .INDENT 0.0
  57. .INDENT 3.5
  58. If you copy a repository with the lock held, the lock will be present in
  59. the copy. Thus, before using borg on the copy from a different host,
  60. you need to use \(dqborg break\-lock\(dq on the copied repository, because
  61. Borg is cautious and does not automatically remove stale locks made by a different host.
  62. .UNINDENT
  63. .UNINDENT
  64. .SH OPTIONS
  65. .sp
  66. See \fIborg\-common(1)\fP for common options of Borg commands.
  67. .SS arguments
  68. .INDENT 0.0
  69. .TP
  70. .B REPOSITORY
  71. repository to lock
  72. .TP
  73. .B COMMAND
  74. command to run
  75. .TP
  76. .B ARGS
  77. command arguments
  78. .UNINDENT
  79. .SH SEE ALSO
  80. .sp
  81. \fIborg\-common(1)\fP
  82. .SH AUTHOR
  83. The Borg Collective
  84. .\" Generated by docutils manpage writer.
  85. .