borg-with-lock(1)
π borg-with-lock(1) β the borg backup tool's most "hold my hand while I do crimes" moment
okay bestie, so this is borg-with-lock(1), and honestly? it's giving bodyguard energy. you tell borg "hey hold this lock for me" and it just... does it, while your command runs. iconic. periodt. π«Ά
β¨ Name β¨
borg-with-lock β run a user specified command with the repository lock held
like, the whole personality of this command is "I will guard the door while you do your thing." no cap. πͺπ
πΈ SYNOPSIS πΈ
borg [common options] with-lock [options] REPOSITORY COMMAND [ARGS...]
π DESCRIPTION π
so this command literally runs a user-specified command while locking the repository. that's it. that's the vibe. here's an example, and yes it's the real one:
$ borg with-lock /mnt/borgrepo rsync -av /mnt/borgrepo /somewhere/else/borgrepo
the way that it works: first it tries to acquire the lock (aka it makes sure no other operation is running in the repository π), then it executes the given command as a subprocess and waits for its termination, releases the lock, and returns the user command's return code as Borg's return code. slay. β¨
Note (important, bestie, don't skip this one π): if you copy a repository with the lock held, the lock will be present in the copy. so before using Borg on the copy from a different host, you need to use borg break-lock on the copied repository β because Borg is cautious and does not automatically remove stale locks made by a different host. it's not being shady, it's just careful. π
π OPTIONS π
See borg-common(1) for common options of Borg commands.
π arguments
REPOSITORYβ repository to lock π (the thing we're guarding, the main character's house)COMMANDβ command to run πβοΈ (the thing it's guarding for)ARGSβ command arguments π (all the little extra bits your command needs)
π SEE ALSO π
π¦ Author π¦
The Borg Collective π
and that's the whole page, bestie! you understood it, you ate, no crumbs left. this was page borg-with-lock(1) from the borg backup tool, dated 2026-07-18 β go forth and lock responsibly, mwah π
β¨π
π¦ where this page comes from
- alpine 3.24: borgbackup-doc 1.4.5-r0 Β· BSD-3-Clause
- arch rolling: borg 1.4.5-1 Β· BSD
- ubuntu stonking: borgbackup 1.4.5-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms