2020-12-14 15:50:39 +01:00
|
|
|
---
|
2023-10-22 20:33:44 +02:00
|
|
|
- name: Install cron
|
2020-12-14 15:50:39 +01:00
|
|
|
become: true
|
2021-05-11 00:14:17 +02:00
|
|
|
ansible.builtin.package:
|
2020-12-14 15:50:39 +01:00
|
|
|
name: "{{ restic_archiver__package }}"
|
|
|
|
state: present
|
|
|
|
|
2023-10-22 20:33:44 +02:00
|
|
|
- name: Migrate cronjob to cron.d directory
|
2021-12-07 17:31:48 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.cron:
|
|
|
|
name: "archive restic backup with ansible_role_restic_archiver"
|
|
|
|
state: absent
|
|
|
|
|
2023-10-22 20:33:44 +02:00
|
|
|
- name: Setup cronjob for restic with logging
|
2020-12-14 15:50:39 +01:00
|
|
|
become: true
|
2021-05-11 00:14:17 +02:00
|
|
|
ansible.builtin.cron:
|
2020-12-17 14:13:50 +01:00
|
|
|
name: "archive restic backup with ansible_role_restic_archiver"
|
|
|
|
job: /opt/restic-backup.sh >> /var/log/restic/restic_archiver.log
|
2021-12-07 17:31:48 +01:00
|
|
|
cron_file: restic_archiver
|
2020-12-14 15:50:39 +01:00
|
|
|
hour: "{{ restic_archiver__hour }}"
|
|
|
|
minute: "{{ restic_archiver__minute }}"
|
|
|
|
user: "{{ restic_archiver__owner }}"
|
|
|
|
when: restic_archiver__log_output
|
|
|
|
|
2023-10-22 20:33:44 +02:00
|
|
|
- name: Setup cronjob for restic without logging
|
2020-12-14 15:50:39 +01:00
|
|
|
become: true
|
2021-05-11 00:14:17 +02:00
|
|
|
ansible.builtin.cron:
|
2020-12-14 15:50:39 +01:00
|
|
|
name: "archive restic backup with ansible_role_restic_archiver"
|
|
|
|
job: /opt/restic-backup.sh
|
2021-12-07 17:31:48 +01:00
|
|
|
cron_file: restic_archiver
|
2020-12-14 15:50:39 +01:00
|
|
|
hour: "{{ restic_archiver__hour }}"
|
|
|
|
minute: "{{ restic_archiver__minute }}"
|
|
|
|
user: "{{ restic_archiver__owner }}"
|
|
|
|
when: not restic_archiver__log_output
|