2026-03-15 09:34:31 -04:00
|
|
|
.\" Man page generated from reStructuredText
|
|
|
|
|
.\" by the Docutils 0.22.4 manpage writer.
|
2017-02-05 08:22:06 -05:00
|
|
|
.
|
|
|
|
|
.
|
|
|
|
|
.nr rst2man-indent-level 0
|
|
|
|
|
.
|
|
|
|
|
.de1 rstReportMargin
|
|
|
|
|
\\$1 \\n[an-margin]
|
|
|
|
|
level \\n[rst2man-indent-level]
|
|
|
|
|
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
|
|
-
|
|
|
|
|
\\n[rst2man-indent0]
|
|
|
|
|
\\n[rst2man-indent1]
|
|
|
|
|
\\n[rst2man-indent2]
|
|
|
|
|
..
|
|
|
|
|
.de1 INDENT
|
|
|
|
|
.\" .rstReportMargin pre:
|
|
|
|
|
. RS \\$1
|
|
|
|
|
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
|
|
|
|
|
. nr rst2man-indent-level +1
|
|
|
|
|
.\" .rstReportMargin post:
|
|
|
|
|
..
|
|
|
|
|
.de UNINDENT
|
|
|
|
|
. RE
|
|
|
|
|
.\" indent \\n[an-margin]
|
|
|
|
|
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
|
|
.nr rst2man-indent-level -1
|
|
|
|
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
|
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
|
|
|
|
..
|
2026-06-16 08:17:43 -04:00
|
|
|
.TH "borg-with-lock" "1" "2026-06-16" "" "borg backup tool"
|
2026-03-15 09:34:31 -04:00
|
|
|
.SH Name
|
2025-12-23 12:00:09 -05:00
|
|
|
borg-with-lock \- Runs a user-specified command with the repository lock held.
|
2017-02-05 08:22:06 -05:00
|
|
|
.SH SYNOPSIS
|
|
|
|
|
.sp
|
2022-06-23 19:19:19 -04:00
|
|
|
borg [common options] with\-lock [options] COMMAND [ARGS...]
|
2017-02-05 08:22:06 -05:00
|
|
|
.SH DESCRIPTION
|
|
|
|
|
.sp
|
2024-02-20 11:12:43 -05:00
|
|
|
This command runs a user\-specified command while locking the repository. For example:
|
|
|
|
|
.INDENT 0.0
|
|
|
|
|
.INDENT 3.5
|
|
|
|
|
.sp
|
2025-04-21 15:07:46 -04:00
|
|
|
.EX
|
2024-02-20 11:12:43 -05:00
|
|
|
$ BORG_REPO=/mnt/borgrepo borg with\-lock rsync \-av /mnt/borgrepo /somewhere/else/borgrepo
|
2025-04-21 15:07:46 -04:00
|
|
|
.EE
|
2024-02-20 11:12:43 -05:00
|
|
|
.UNINDENT
|
|
|
|
|
.UNINDENT
|
2017-02-05 08:22:06 -05:00
|
|
|
.sp
|
2025-12-23 12:00:09 -05:00
|
|
|
It first tries to acquire the lock (make sure that no other operation is
|
|
|
|
|
running in the repository), then executes the given command as a subprocess and waits
|
|
|
|
|
for its termination, releases the lock, and returns the user command\(aqs return
|
|
|
|
|
code as Borg\(aqs return code.
|
2017-11-25 08:38:04 -05:00
|
|
|
.sp
|
2026-03-15 09:34:31 -04:00
|
|
|
\fBNote:\fP
|
2017-02-05 08:22:06 -05:00
|
|
|
.INDENT 0.0
|
2017-11-25 08:38:04 -05:00
|
|
|
.INDENT 3.5
|
|
|
|
|
If you copy a repository with the lock held, the lock will be present in
|
2025-12-23 12:00:09 -05:00
|
|
|
the copy. Before using Borg on the copy from a different host,
|
|
|
|
|
you need to run \fBborg break\-lock\fP on the copied repository, because
|
2017-11-25 08:38:04 -05:00
|
|
|
Borg is cautious and does not automatically remove stale locks made by a different host.
|
|
|
|
|
.UNINDENT
|
2017-02-05 08:22:06 -05:00
|
|
|
.UNINDENT
|
|
|
|
|
.SH OPTIONS
|
|
|
|
|
.sp
|
|
|
|
|
See \fIborg\-common(1)\fP for common options of Borg commands.
|
|
|
|
|
.SS arguments
|
|
|
|
|
.INDENT 0.0
|
|
|
|
|
.TP
|
|
|
|
|
.B COMMAND
|
|
|
|
|
command to run
|
|
|
|
|
.TP
|
|
|
|
|
.B ARGS
|
|
|
|
|
command arguments
|
|
|
|
|
.UNINDENT
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
.sp
|
|
|
|
|
\fIborg\-common(1)\fP
|
2026-03-15 09:34:31 -04:00
|
|
|
.SH Author
|
2017-02-05 08:22:06 -05:00
|
|
|
The Borg Collective
|
2026-03-15 09:34:31 -04:00
|
|
|
.\" End of generated man page.
|