1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic_archiver.git synced 2024-08-16 10:09:49 +02:00
ansible_role_restic_archiver/tasks/cron.yml
2021-01-11 19:01:04 +01:00

40 lines
1.2 KiB
YAML

---
- name: install cron
become: true
package:
name: "{{ restic_archiver__package }}"
state: present
- name: setup cronjob for restic with logging
become: true
cron:
name: "archive restic backup with ansible_role_restic_archiver"
job: /opt/restic-backup.sh >> /var/log/restic/restic_archiver.log
cron_file: /etc/crontab
hour: "{{ restic_archiver__hour }}"
minute: "{{ restic_archiver__minute }}"
user: "{{ restic_archiver__owner }}"
when: restic_archiver__log_output
- name: setup cronjob for restic without logging
become: true
cron:
name: "archive restic backup with ansible_role_restic_archiver"
job: /opt/restic-backup.sh
cron_file: /etc/crontab
hour: "{{ restic_archiver__hour }}"
minute: "{{ restic_archiver__minute }}"
user: "{{ restic_archiver__owner }}"
when: not restic_archiver__log_output
- name: setup cronjob for restic without logging
become: true
cron:
name: "archive restic backup with ansible_role_restic_archiver"
job: /opt/restic-mailsummary.sh
cron_file: /etc/crontab
hour: "7"
minute: "30"
user: "{{ restic_archiver__owner }}"
when: restic_archiver__mailsummary