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

35 lines
1.1 KiB
YAML
Raw Normal View History

2020-12-14 15:50:39 +01:00
---
- name: install cron
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
2021-12-07 17:31:48 +01:00
- name: migrate cronjob to cron.d directory
become: true
ansible.builtin.cron:
name: "archive restic backup with ansible_role_restic_archiver"
state: absent
2020-12-14 15:50:39 +01:00
- name: setup cronjob for restic with logging
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
- name: setup cronjob for restic without logging
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