diff --git a/templates/config.yaml.j2 b/templates/config.yaml.j2 index d15e6d8..1d059f2 100644 --- a/templates/config.yaml.j2 +++ b/templates/config.yaml.j2 @@ -105,6 +105,9 @@ retry_wait: {{ borgmatic_retry_wait }} # ssh_command: ssh -i ~/.ssh/id_ed25519 {% if borg_ssh_command %} ssh_command: {{ borg_ssh_command }} +{% elif borg_ssh_key_name != 'id_' ~ borg_ssh_key_type %} +# Auto-configured for non-default SSH key +ssh_command: ssh -i {{ borg_ssh_key_file_path }} {% endif %} # Umask to be used for borg create. diff --git a/templates/config_1.7.yaml.j2 b/templates/config_1.7.yaml.j2 index 4193c7e..ed784db 100644 --- a/templates/config_1.7.yaml.j2 +++ b/templates/config_1.7.yaml.j2 @@ -106,6 +106,9 @@ storage: # ssh_command: ssh -i ~/.ssh/id_ed25519 {% if borg_ssh_command %} ssh_command: {{ borg_ssh_command }} +{% elif borg_ssh_key_name != 'id_' ~ borg_ssh_key_type %} + # Auto-configured for non-default SSH key + ssh_command: ssh -i {{ borg_ssh_key_file_path }} {% endif %} # Umask to be used for borg create.