From ecb20d77a089e01c121613bbd22a2c7f8d10322b Mon Sep 17 00:00:00 2001 From: camille Date: Tue, 27 Jun 2023 16:24:27 +0200 Subject: [PATCH] duplicity - add backup name --- defaults/main.yml | 1 + tasks/duplicity.yml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 8084958..348af0b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,6 +2,7 @@ # duplicity duplicity_oneforall_key: False duplicity_archive_dir: '/duplicity' +duplicity_backup_name: 'daily' duplicity_gpg_real_name: 'duplicity' duplicity_gpg_email: 'team-lca@alterway.fr' diff --git a/tasks/duplicity.yml b/tasks/duplicity.yml index 646ee2b..9d90526 100644 --- a/tasks/duplicity.yml +++ b/tasks/duplicity.yml @@ -225,7 +225,7 @@ month: "{{ duplicity_cron_backup_month }}" weekday: "{{ duplicity_cron_backup_weekday }}" user: "{{ duplicity_cron_backup_user }}" - job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --s3-use-new-style -v 4 --archive-dir={{ duplicity_archive_dir }} --full-if-older-than {{ duplicity_full_older_than }}D / \"{{ duplicity_s3_path }}\" --exclude-filelist {{ duplicity_exclude_filelist }}" + job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --name {{ duplicity_backup_name }} --s3-use-new-style -v 4 --archive-dir={{ duplicity_archive_dir }} --full-if-older-than {{ duplicity_full_older_than }}D / \"{{ duplicity_s3_path }}\" --exclude-filelist {{ duplicity_exclude_filelist }}" when: - duplicity_gpg_key is defined - '"s3" in duplicity_backend' @@ -240,7 +240,7 @@ month: "{{ duplicity_cron_backup_month }}" weekday: "{{ duplicity_cron_backup_weekday }}" user: "{{ duplicity_cron_backup_user }}" - job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --force --s3-use-new-style -v 4 --archive-dir={{ duplicity_archive_dir }} remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_s3_path }}\"" + job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --name {{ duplicity_backup_name }} --force --s3-use-new-style -v 4 --archive-dir={{ duplicity_archive_dir }} remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_s3_path }}\"" when: - duplicity_gpg_key is defined - '"s3" in duplicity_backend' @@ -255,7 +255,7 @@ month: "{{ duplicity_cron_backup_month }}" weekday: "{{ duplicity_cron_backup_weekday }}" user: "{{ duplicity_cron_backup_user }}" - job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --archive-dir={{ duplicity_archive_dir }} --full-if-older-than {{ duplicity_full_older_than }}D / \"{{ duplicity_azure_path }}\" --exclude-filelist {{ duplicity_exclude_filelist }}" + job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --name {{ duplicity_backup_name }} --archive-dir={{ duplicity_archive_dir }} --full-if-older-than {{ duplicity_full_older_than }}D / \"{{ duplicity_azure_path }}\" --exclude-filelist {{ duplicity_exclude_filelist }}" when: - duplicity_gpg_key is defined - '"azure" in duplicity_backend' @@ -270,7 +270,7 @@ month: "{{ duplicity_cron_backup_month }}" weekday: "{{ duplicity_cron_backup_weekday }}" user: "{{ duplicity_cron_backup_user }}" - job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --archive-dir={{ duplicity_archive_dir }} --force remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_azure_path }}\"" + job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --name {{ duplicity_backup_name }} --archive-dir={{ duplicity_archive_dir }} --force remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_azure_path }}\"" when: - duplicity_gpg_key is defined - '"azure" in duplicity_backend'