diff --git a/borgmatic/borg/environment.py b/borgmatic/borg/environment.py index 0bee5711..ac7ffcfd 100644 --- a/borgmatic/borg/environment.py +++ b/borgmatic/borg/environment.py @@ -17,6 +17,7 @@ OPTION_TO_ENVIRONMENT_VARIABLE = { DEFAULT_BOOL_OPTION_TO_DOWNCASE_ENVIRONMENT_VARIABLE = { 'relocated_repo_access_is_ok': 'BORG_RELOCATED_REPO_ACCESS_IS_OK', 'unknown_unencrypted_repo_access_is_ok': 'BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK', + 'use_chunks_archive': 'BORG_USE_CHUNKS_ARCHIVE', } DEFAULT_BOOL_OPTION_TO_UPPERCASE_ENVIRONMENT_VARIABLE = { @@ -79,9 +80,6 @@ def make_environment(config): os.set_inheritable(read_file_descriptor, True) environment['BORG_PASSPHRASE_FD'] = str(read_file_descriptor) - if 'use_chunks_archive' in config: - environment['BORG_USE_CHUNKS_ARCHIVE'] = 'yes' if config.get('use_chunks_archive') else 'no' - for ( option_name, environment_variable_name, diff --git a/borgmatic/config/schema.yaml b/borgmatic/config/schema.yaml index f20490ca..494b0d70 100644 --- a/borgmatic/config/schema.yaml +++ b/borgmatic/config/schema.yaml @@ -395,7 +395,7 @@ properties: Enables or disables the use of chunks.archive.d for faster cache resyncs in Borg. If true, value is set to "yes" (default) else it's set to "no", reducing disk usage but slowing resyncs. - default: true + example: true borg_files_cache_ttl: type: integer description: | diff --git a/tests/unit/borg/test_environment.py b/tests/unit/borg/test_environment.py index 093a0c6d..4631f62f 100644 --- a/tests/unit/borg/test_environment.py +++ b/tests/unit/borg/test_environment.py @@ -92,6 +92,7 @@ def test_make_environment_without_configuration_sets_certain_environment_variabl 'BORG_EXIT_CODES': 'modern', 'BORG_RELOCATED_REPO_ACCESS_IS_OK': 'no', 'BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK': 'no', + 'BORG_USE_CHUNKS_ARCHIVE': 'no', } @@ -101,6 +102,7 @@ def test_make_environment_without_configuration_passes_through_default_environme 'USER': 'root', 'BORG_RELOCATED_REPO_ACCESS_IS_OK': 'yup', 'BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK': 'nah', + 'BORG_USE_CHUNKS_ARCHIVE': 'yup', } ) flexmock(module.borgmatic.hooks.credential.parse).should_receive( @@ -113,6 +115,7 @@ def test_make_environment_without_configuration_passes_through_default_environme 'USER': 'root', 'BORG_RELOCATED_REPO_ACCESS_IS_OK': 'yup', 'BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK': 'nah', + 'BORG_USE_CHUNKS_ARCHIVE': 'yup', 'BORG_EXIT_CODES': 'modern', }