From 9f07fd80577e9dec863a88d3dc44875418a8c943 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 13 Aug 2026 23:03:14 +0200 Subject: [PATCH] with-lock: fix epilog about leftover lock auto-removal, see #9870 Co-Authored-By: Claude Fable 5 --- docs/man/borg-with-lock.1 | 8 ++++---- docs/usage/with-lock.rst.inc | 6 +++--- src/borg/archiver/lock_cmds.py | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/man/borg-with-lock.1 b/docs/man/borg-with-lock.1 index 511e306e0..4e8c87f51 100644 --- a/docs/man/borg-with-lock.1 +++ b/docs/man/borg-with-lock.1 @@ -28,7 +28,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "borg-with-lock" "1" "2026-07-21" "" "borg backup tool" +.TH "borg-with-lock" "1" "2026-08-13" "" "borg backup tool" .SH Name borg-with-lock \- Runs a user-specified command with the repository lock held. .SH SYNOPSIS @@ -55,9 +55,9 @@ code as Borg\(aqs return code. .INDENT 0.0 .INDENT 3.5 If you copy a repository with the lock held, the lock will be present in -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 -Borg is cautious and does not automatically remove stale locks made by a different host. +the copy. Borg removes such a leftover lock automatically, but only after +a safety period of about half an hour, so to use Borg on the copy right +away, first run \fBborg break\-lock\fP on the copied repository. .UNINDENT .UNINDENT .SH OPTIONS diff --git a/docs/usage/with-lock.rst.inc b/docs/usage/with-lock.rst.inc index 8e8db70bb..fa5f148e5 100644 --- a/docs/usage/with-lock.rst.inc +++ b/docs/usage/with-lock.rst.inc @@ -60,6 +60,6 @@ code as Borg's return code. .. note:: If you copy a repository with the lock held, the lock will be present in - the copy. Before using Borg on the copy from a different host, - you need to run ``borg break-lock`` on the copied repository, because - Borg is cautious and does not automatically remove stale locks made by a different host. \ No newline at end of file + the copy. Borg removes such a leftover lock automatically, but only after + a safety period of about half an hour, so to use Borg on the copy right + away, first run ``borg break-lock`` on the copied repository. \ No newline at end of file diff --git a/src/borg/archiver/lock_cmds.py b/src/borg/archiver/lock_cmds.py index 10c2751e1..209535be0 100644 --- a/src/borg/archiver/lock_cmds.py +++ b/src/borg/archiver/lock_cmds.py @@ -67,9 +67,9 @@ class LocksMixIn: .. note:: If you copy a repository with the lock held, the lock will be present in - the copy. Before using Borg on the copy from a different host, - you need to run ``borg break-lock`` on the copied repository, because - Borg is cautious and does not automatically remove stale locks made by a different host. + the copy. Borg removes such a leftover lock automatically, but only after + a safety period of about half an hour, so to use Borg on the copy right + away, first run ``borg break-lock`` on the copied repository. """ ) subparser = ArgumentParser(