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