fix cron and delay cleanup

This commit is contained in:
camille 2023-01-04 10:30:53 +01:00
parent b57ecfc471
commit d42a2640c1
2 changed files with 6 additions and 7 deletions

View File

@ -6,8 +6,8 @@ duplicity_archive_dir: '/duplicity'
duplicity_gpg_real_name: 'duplicity' duplicity_gpg_real_name: 'duplicity'
duplicity_gpg_email: 'team-lca@alterway.fr' duplicity_gpg_email: 'team-lca@alterway.fr'
duplicity_cron_backup_minute: '0' duplicity_cron_backup_minute: 0
duplicity_cron_backup_hour: '3' duplicity_cron_backup_hour: 3
duplicity_cron_backup_day: '*' duplicity_cron_backup_day: '*'
duplicity_cron_backup_month: '*' duplicity_cron_backup_month: '*'
duplicity_cron_backup_weekday: '*' duplicity_cron_backup_weekday: '*'
@ -34,7 +34,6 @@ duplicity_list:
- /var/lib/solr - /var/lib/solr
- /var/lib/elasticsearch - /var/lib/elasticsearch
- /var/spool/postfix - /var/spool/postfix
- /var/www
- /VMs - /VMs
- /.journal - /.journal
- /.fsck - /.fsck

View File

@ -214,7 +214,7 @@
month: "{{ duplicity_cron_backup_month }}" month: "{{ duplicity_cron_backup_month }}"
weekday: "{{ duplicity_cron_backup_weekday }}" weekday: "{{ duplicity_cron_backup_weekday }}"
user: "{{ duplicity_cron_backup_user }}" user: "{{ duplicity_cron_backup_user }}"
job: "source /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 }} --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: when:
- duplicity_gpg_key is defined - duplicity_gpg_key is defined
tags: ['backup_duplicity'] tags: ['backup_duplicity']
@ -222,13 +222,13 @@
- name: duplicity | create cleanup cronjob - name: duplicity | create cleanup cronjob
cron: cron:
name: duplicity cleanup name: duplicity cleanup
minute: "{{ duplicity_cron_backup_minute }}" minute: "{{ duplicity_cron_backup_minute+30 }}"
hour: "{{ duplicity_cron_backup_hour }}" hour: "{{ duplicity_cron_backup_hour+3 }}"
day: "{{ duplicity_cron_backup_day }}" day: "{{ duplicity_cron_backup_day }}"
month: "{{ duplicity_cron_backup_month }}" month: "{{ duplicity_cron_backup_month }}"
weekday: "{{ duplicity_cron_backup_weekday }}" weekday: "{{ duplicity_cron_backup_weekday }}"
user: "{{ duplicity_cron_backup_user }}" user: "{{ duplicity_cron_backup_user }}"
job: "source /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --force --s3-use-new-style -v 4 remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_s3_path }}\"" job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --force --s3-use-new-style -v 4 remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_s3_path }}\""
when: when:
- duplicity_gpg_key is defined - duplicity_gpg_key is defined
tags: ['backup_duplicity'] tags: ['backup_duplicity']