mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2025-10-25 11:24:41 +02:00
34 lines
1007 B
YAML
34 lines
1007 B
YAML
---
|
|
- name: Add cron-job for borgmatic
|
|
when:
|
|
- borgmatic_timer is defined and borgmatic_timer == "cron"
|
|
tags:
|
|
- install_backup
|
|
block:
|
|
- name: Add cron job for create, check and prune
|
|
cron:
|
|
name: "{{ borgmatic_timer_cron_name }}"
|
|
hour: "{{ borgmatic_timer_hour }}"
|
|
minute: "{{ borgmatic_timer_minute }}"
|
|
user: "{{ borgbackup_user }}"
|
|
cron_file: "{{ borgmatic_timer_cron_name }}"
|
|
job: "/usr/local/bin/borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }}"
|
|
|
|
- name: Ensure separate check cron job is absent
|
|
cron:
|
|
name: "{{ borgmatic_timer_cron_name }}-check"
|
|
state: absent
|
|
|
|
- name: Set PATH for borgmatic cron job.
|
|
when:
|
|
- borgmatic_timer is defined and borgmatic_timer == "cron"
|
|
tags:
|
|
- install_backup
|
|
cron:
|
|
user: "{{ borgbackup_user }}"
|
|
cron_file: "{{ borgmatic_timer_cron_name }}"
|
|
name: PATH
|
|
env: yes
|
|
value: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
...
|