mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 01:37:20 +00:00
Add placeholder for fqdn in reverse notation
(cherry picked from commit 85fb38e2f3
)
This commit is contained in:
parent
981a936f47
commit
dbf8d582f9
4 changed files with 10 additions and 0 deletions
|
@ -42,6 +42,9 @@ The (short) hostname of the machine.
|
|||
.B {fqdn}
|
||||
The full name of the machine.
|
||||
.TP
|
||||
.B {reverse-fqdn}
|
||||
The full name of the machine in reverse domain name notation.
|
||||
.TP
|
||||
.B {now}
|
||||
The current local date and time, by default in ISO\-8601 format.
|
||||
You can also supply your own \fI\%format string\fP, e.g. {now:%Y\-%m\-%d_%H:%M:%S}
|
||||
|
|
|
@ -169,6 +169,9 @@ placeholders:
|
|||
{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.4/library/datetime.html#strftime-and-strptime-behavior>`_, e.g. {now:%Y-%m-%d_%H:%M:%S}
|
||||
|
|
|
@ -2093,6 +2093,9 @@ def do_break_lock(self, args, repository):
|
|||
{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.4/library/datetime.html#strftime-and-strptime-behavior>`_, e.g. {now:%Y-%m-%d_%H:%M:%S}
|
||||
|
|
|
@ -664,6 +664,7 @@ def replace_placeholders(text):
|
|||
data = {
|
||||
'pid': os.getpid(),
|
||||
'fqdn': socket.getfqdn(),
|
||||
'reverse-fqdn': '.'.join(reversed(socket.getfqdn().split('.'))),
|
||||
'hostname': socket.gethostname(),
|
||||
'now': DatetimeWrapper(current_time.now()),
|
||||
'utcnow': DatetimeWrapper(current_time.utcnow()),
|
||||
|
|
Loading…
Reference in a new issue