mirror of
https://github.com/roles-ansible/ansible_role_restic_archiver.git
synced 2024-08-16 10:09:49 +02:00
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
---
|
|
- name: Install cron
|
|
become: true
|
|
ansible.builtin.package:
|
|
name: "{{ restic_archiver__package }}"
|
|
state: present
|
|
|
|
- name: Migrate cronjob to cron.d directory
|
|
become: true
|
|
ansible.builtin.cron:
|
|
name: "archive restic backup with ansible_role_restic_archiver"
|
|
state: absent
|
|
|
|
- name: Setup cronjob for restic with logging
|
|
become: true
|
|
ansible.builtin.cron:
|
|
name: "archive restic backup with ansible_role_restic_archiver"
|
|
job: /opt/restic-backup.sh >> /var/log/restic/restic_archiver.log
|
|
cron_file: restic_archiver
|
|
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
|
|
ansible.builtin.cron:
|
|
name: "archive restic backup with ansible_role_restic_archiver"
|
|
job: /opt/restic-backup.sh
|
|
cron_file: restic_archiver
|
|
hour: "{{ restic_archiver__hour }}"
|
|
minute: "{{ restic_archiver__minute }}"
|
|
user: "{{ restic_archiver__owner }}"
|
|
when: not restic_archiver__log_output
|