align borg and burp folders to backup, switch to systemd for scheduling

This commit is contained in:
2026-01-24 10:44:35 +01:00
parent 17d54301f7
commit c111d737bb
7 changed files with 41 additions and 25 deletions

View File

@@ -1,10 +1,16 @@
- name: Deploy cronjob backup_tout_court
vars:
minutes: "{{ 59 | random(seed=inventory_hostname) }}"
cron:
name: backup
cron_file: backup
user: root
hour: "2"
minute: "{{ minutes }}"
job: "{{ borg_script_dir }}/borg.sh"
- name: Deploy systemd service and timer unit files
ansible.builtin.template:
src: "{{ item }}"
dest: /etc/systemd/system/
notify: reload systemd
loop:
- borg_backup.service
- borg_backup.timer
- ansible.builtin.meta: flush_handlers
- name: enable and start timer
ansible.builtin.systemd:
name: borg_backup.timer
state: started
enabled: true