borg-with-lock(1)
β¨ borg-with-lock β bestie edition β¨
okay so this is the borg-with-lock page from the borg backup tool manual, and honestly? it's giving "hold my lock while I do a thing" energy π
π NAME π
okay so borg-with-lock β it runs a user-specified command with the repository lock held. that's it. that's the whole vibe. you hand it a command, it grabs the lock, and your command gets to do its little thing while nobody else can touch the repo. iconic behavior fr fr π₯
β¨ SYNOPSIS β¨
borg [common options] with-lock [options] COMMAND [ARGS...]
literally just that. the [common options] slot is where all the shared Borg stuff goes, [options] is this command's own biz, and then COMMAND [ARGS...] is your moment, bestie π
πΈ DESCRIPTION πΈ
so like, this command runs a user-specified command while locking the repository. no cap. here's an example so you can see it in the wild:
$ BORG_REPO=/mnt/borgrepo borg with-lock rsync -av /mnt/borgrepo /somewhere/else/borgrepo
the way it works is SO satisfying, let me walk you through it:
- it first tries to acquire the lock β which is the fancy way of saying it makes sure that no other operation is running in the repository π«Ά
- then it executes the given command as a subprocess and waits for it to finish (patient queen behavior, we love to see it) π
- then it releases the lock π
- and finally it returns the user command's return code as Borg's return code π
so yeah, whatever your command exits with, that's what you get back. simple. clean. slay.
π important note, do NOT skip this one bestie: if you copy a repository with the lock held, the lock will be present in the copy. yep, it comes along for the ride π 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. consider this your lil' PSA π
π OPTIONS π
See borg-common(1) for common options of Borg commands. all the shared goodies live over there π
π arguments
COMMANDβ command to run. this is the thing you're handing over to Borg so it can be executed while the lock is held. your main character, basically.ARGSβ command arguments. all the extra lil' bits and flags and paths thatCOMMANDneeds. yes, plural, you can pass as many as you want π
π¦ SEE ALSO π¦
β AUTHOR β
The Borg Collective π«‘ β legends, honestly. no notes.
and that's the whole page! this was rendered for the borg backup tool, page borg-with-lock(1), dated 2026-10-07 β¨ go forth and hold that lock, bestie, you're gonna eat ππ§π
π¦ where this page comes from
- ubuntu stonking: borgbackup2 2.0.0b25-4 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms