mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-22 02:03:01 +02:00
Add an "--archive-hostname" flag and corresponding "archive_hostname" option for overriding the hostname used when creating an archive (#1317).
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
2.1.7.dev0
|
||||
* #1309: Add support for the "--quick-stats" flag and the "quick_statistics" option to the "prune"
|
||||
action. Borg >= 1.4.5 and < 2 only.
|
||||
* #1317: Add an "--archive-hostname" flag and corresponding "archive_hostname" option for
|
||||
overriding the hostname used when creating an archive, e.g. via the "{hostname}" placeholder in
|
||||
the "archive_name_format" option.
|
||||
* #1319: Fix the ZFS hook's overzealous unmounting of snapshot paths when a source dataset is at
|
||||
"/".
|
||||
* #1322: Fix for the "restore" action sometimes failing to find a database dump that was dumped
|
||||
|
||||
@@ -199,6 +199,7 @@ def make_base_create_command( # noqa: PLR0912
|
||||
list_filter_flags = flags.make_list_filter_flags(local_borg_version, dry_run)
|
||||
files_changed = config.get('files_changed')
|
||||
files_cache = config.get('files_cache')
|
||||
archive_hostname = config.get('archive_hostname')
|
||||
archive_name_format = (
|
||||
config.get('archive_name_format', flags.get_default_archive_name_format(local_borg_version))
|
||||
+ archive_suffix
|
||||
@@ -250,6 +251,7 @@ def make_base_create_command( # noqa: PLR0912
|
||||
+ noflags_flags
|
||||
+ (('--files-changed', files_changed) if files_changed else ())
|
||||
+ (('--files-cache', files_cache) if files_cache else ())
|
||||
+ (('--hostname', archive_hostname) if archive_hostname else ())
|
||||
+ (('--remote-path', remote_path) if remote_path else ())
|
||||
+ (('--umask', str(umask)) if umask else ())
|
||||
+ (('--lock-wait', str(lock_wait)) if lock_wait else ())
|
||||
|
||||
@@ -511,6 +511,13 @@ properties:
|
||||
info, or check, borgmatic automatically tries to match only
|
||||
archives created with this name format.
|
||||
example: "{hostname}-documents-{now}"
|
||||
archive_hostname:
|
||||
type: string
|
||||
description: |
|
||||
Hostname to use when creating an archive, e.g. via the "{hostname}"
|
||||
placeholder in "archive_name_format". Defaults to the system
|
||||
hostname. (This option is supported for Borg 1.4.5+ only.)
|
||||
example: example.org
|
||||
match_archives:
|
||||
type: string
|
||||
description: |
|
||||
|
||||
@@ -518,6 +518,7 @@ def test_make_base_create_command_with_store_config_false_omits_config_files():
|
||||
('flags', False, False, ('--nobsdflags',)),
|
||||
('files_changed', 'mtime', True, ('--files-changed', 'mtime')),
|
||||
('files_cache', 'ctime,size', True, ('--files-cache', 'ctime,size')),
|
||||
('archive_hostname', 'example.org', True, ('--hostname', 'example.org')),
|
||||
('umask', 740, True, ('--umask', '740')),
|
||||
('lock_wait', 5, True, ('--lock-wait', '5')),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user