mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-21 21:57:36 +00:00
Merge pull request #2546 from enkore/issue/2543
docs: add systemd warning regarding placeholders
This commit is contained in:
commit
dc02c79e97
2 changed files with 21 additions and 1 deletions
|
@ -206,6 +206,16 @@ Examples::
|
||||||
borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ...
|
borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ...
|
||||||
borg prune --prefix '{hostname}-' ...
|
borg prune --prefix '{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}``).
|
||||||
|
|
||||||
.. _borg_compression:
|
.. _borg_compression:
|
||||||
|
|
||||||
borg help compression
|
borg help compression
|
||||||
|
|
|
@ -2009,7 +2009,17 @@ def do_break_lock(self, args, repository):
|
||||||
|
|
||||||
borg create /path/to/repo::{hostname}-{user}-{utcnow} ...
|
borg create /path/to/repo::{hostname}-{user}-{utcnow} ...
|
||||||
borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ...
|
borg create /path/to/repo::{hostname}-{now:%Y-%m-%d_%H:%M:%S} ...
|
||||||
borg prune --prefix '{hostname}-' ...\n\n''')
|
borg prune --prefix '{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}``).\n\n''')
|
||||||
helptext['compression'] = textwrap.dedent('''
|
helptext['compression'] = textwrap.dedent('''
|
||||||
Compression is lz4 by default. If you want something else, you have to specify what you want.
|
Compression is lz4 by default. If you want something else, you have to specify what you want.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue