borg-placeholders(1)
β¨ NAME β¨
borg-placeholders β the whole entire lore on placeholders, bestie π (this is section 1 of the borg backup tool manual, if you were wondering).
πΈ DESCRIPTION πΈ
okay so listen. some of the stuff you type at borg can have lil magic words inside them, and borg will swap those magic words out for real values before it does anything. the spots that support this:
- Repository (or Archive) URLs π«Ά
--prefix--glob-archives--comment--remote-path
here's every single placeholder, no skips, no cap:
{hostname}β the (short) hostname of the machine. the nickname version, not the whole legal name.{fqdn}β the full name of the machine. the whole government name π{reverse-fqdn}β the full name of the machine, but in reverse domain name notation. backwards but make it fashion π{now}β the current local date and time, and by default it's in ISO-8601 format. you can also supply your own format string (https://docs.python.org/3.10/library/datetime.html#strftime-and-strptime-behavior), e.g.{now:%Y-%m-%d_%H:%M:%S}β yes bestie you get to choose the fit β¨{utcnow}β the current UTC date and time, by default in ISO-8601 format. you can also supply your own format string (https://docs.python.org/3.10/library/datetime.html#strftime-and-strptime-behavior), e.g.{utcnow:%Y-%m-%d_%H:%M:%S}{user}β the user name (or the UID, if there's no name available) of whoever's running borg. main character energy π{pid}β the current process ID. it's giving "this specific run of borg and nobody else".{borgversion}β the version of borg, e.g.:1.0.8rc1{borgmajor}β the version of borg, only the major version, e.g.:1{borgminor}β the version of borg, only major and minor version, e.g.:1.0{borgpatch}β the version of borg, only major, minor and patch version, e.g.:1.0.8
π escaping, aka "i literally just want curly braces" π
if you need literal curly braces, you double them up to escape them. double it and give it to the next person π
borg create /path/to/repo::{{literal_text}}
π¦ EXAMPLES π¦
here's how the girlies actually use it:
borg create /path/to/repo::{hostname}-{user}-{utcnow} ...
borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ...
borg prune --glob-archives '{hostname}-*' ...
β οΈ Note β οΈ
systemd uses a difficult, non-standard syntax for command lines in unit files (refer to the systemd.unit(5) manual page). not me reading that and crying π
When invoking borg from unit files, pay particular attention to escaping, especially when using thenow/utcnowplaceholders, since systemd performs its own%-based variable replacement even in quoted text. To avoid interference from systemd, double all percent signs ({hostname}-{now:%Y-%m-%d_%H:%M:%S}becomes{hostname}-{now:%%Y-%%m-%%d_%%H:%%M:%%S}). fr fr, double those percent signs or systemd will eat your placeholders and you will be sad π
π Author π
The Borg Collective. iconic. no further questions π«Ά
okay that's the whole page, bestie β this was borg-placeholders(1) from the borg backup tool, version stamped 2026-07-18. go forth and placeholder responsibly β¨ππ
π¦ 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