borg-with-lock.1 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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-09-08" "" "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] 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_REPO=/mnt/borgrepo borg with\-lock 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 COMMAND
  71. command to run
  72. .TP
  73. .B ARGS
  74. command arguments
  75. .UNINDENT
  76. .SH SEE ALSO
  77. .sp
  78. \fIborg\-common(1)\fP
  79. .SH AUTHOR
  80. The Borg Collective
  81. .\" Generated by docutils manpage writer.
  82. .