diff --git a/README.md b/README.md index d8ee436..a0c718a 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl - `borgmatic_cron_checks_day`: Day when cron job for infrequent checks will run. Defaults to `{{ 28 | random }}` - `borgmatic_cron_checks_hour`: Hour when cron job for infrequent checks will run. Defaults to `{{ range(7, 24) | random }}` - `borgmatic_cron_checks_minute`: Minute when cron job for infrequent checks will run. Defaults to `{{ 59 | random }}` -- `borg_archive_name_format`: The format for the archive name, e.g. `{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}`. Defaults to `{hostname}-{now}` +- `borg_archive_name_format`: The format for the archive name, e.g. `{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}`. Defaults to `{hostname}-{now:%Y-%m-%d-%H%M%S}` - `borg_prune_prefix`: The prefix used to select archives to prune. Defaults to `{hostname}-` - `borg_check_prefix`: The prefix used to select archives to check for consistency. Defaults to `{hostname}-` diff --git a/defaults/main.yml b/defaults/main.yml index 55ac7da..d790e59 100755 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -44,6 +44,6 @@ borgmatic_cron_checks_day: "{{ range(1, 28) | random(seed=inventory_hostname) }} borgmatic_cron_checks_hour: "{{ range(9, 24) | random(seed=inventory_hostname) }}" borgmatic_cron_checks_minute: "{{ 59 | random(seed=inventory_hostname) }}" # the following are optional and defined by the user as needed -# borg_archive_name_format: '{hostname}-{now}' +# borg_archive_name_format: '{hostname}-{now:%Y-%m-%d-%H%M%S}' # borg_prune_prefix: '{hostname}-' # borg_check_prefix: '{hostname}-' diff --git a/templates/config.yaml.j2 b/templates/config.yaml.j2 index 5d5810f..261bcfc 100644 --- a/templates/config.yaml.j2 +++ b/templates/config.yaml.j2 @@ -97,7 +97,7 @@ storage: {% if borg_archive_name_format is defined %} archive_name_format: '{{ borg_archive_name_format | replace("'", "") }}' {% elif borg_prune_prefix is defined %} - archive_name_format: '{{ borg_prune_prefix | replace("'", "") }}-{now}' + archive_name_format: '{{ borg_prune_prefix | replace("'", "") }}-{now:%Y-%m-%d-%H%M%S}' {% else %} archive_name_format: '{hostname}-{now:%Y-%m-%d-%H%M%S}' {% endif %}