diff --git a/docs/man/borg-placeholders.1 b/docs/man/borg-placeholders.1 index 3e61b7922..ba7a631a7 100644 --- a/docs/man/borg-placeholders.1 +++ b/docs/man/borg-placeholders.1 @@ -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} diff --git a/docs/usage/help.rst.inc b/docs/usage/help.rst.inc index c5fb6a71e..bed681768 100644 --- a/docs/usage/help.rst.inc +++ b/docs/usage/help.rst.inc @@ -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 `_, e.g. {now:%Y-%m-%d_%H:%M:%S} diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 9bc5db614..888e66025 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2093,6 +2093,9 @@ class Archiver: {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 `_, e.g. {now:%Y-%m-%d_%H:%M:%S} diff --git a/src/borg/helpers.py b/src/borg/helpers.py index e5f9de5ad..5008f0188 100644 --- a/src/borg/helpers.py +++ b/src/borg/helpers.py @@ -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()),