borg-placeholders - Details regarding placeholders
Repository URLs, --name, -a /
--match-archives, --comment and --remote-path values
support these placeholders:
- {hostname}
- The (short) hostname of the machine.
- {fqdn}
- The full name of the machine.
- {reverse-fqdn}
- The full name of the machine in reverse domain name notation.
- {now}
- The current local date and time, by default in ISO-8601 format. You can
also supply your own format string
<https://docs.python.org/3.9/library/datetime.html#strftime-and-strptime-behavior>
, e.g. {now:%Y-%m-%d_%H:%M:%S}
- {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.9/library/datetime.html#strftime-and-strptime-behavior>
, e.g. {utcnow:%Y-%m-%d_%H:%M:%S}
- {user}
- The user name (or UID, if no name is available) of the user running
borg.
- {pid}
- The current process ID.
- {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
If literal curly braces need to be used, double them for
escaping:
borg create /path/to/repo::{{literal_text}}
Examples:
borg create /path/to/repo::{hostname}-{user}-{utcnow} ...
borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S%z} ...
borg prune -a 'sh:{hostname}-*' ...
NOTE:
systemd uses a difficult, non-standard syntax for command
lines in unit files (refer to the
systemd.unit(5) manual page).
When invoking borg from unit files, pay particular attention to
escaping, especially when using the now/utcnow placeholders, 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}).