evobackup: execute canary script before executing backup script

This commit is contained in:
Jérémy Dubois 2023-03-21 18:11:17 +01:00
parent 7ab102376f
commit 264c58a03d
3 changed files with 27 additions and 2 deletions

View file

@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* base: set the lookup option so that resolv.conf searches /etc/hosts before querying a domain name server; the default is the opposite
* post-install: add the pf_states check by default in generateldif.sh script
* nagios-nrpe: allow older cipher suites for older Icinga version
* evobackup: execute canary script before executing backup script
### Changed

View file

@ -0,0 +1,3 @@
#!/bin/sh
update-evobackup-canary --who @daily

View file

@ -12,6 +12,17 @@
tags:
- evobackup
- name: "Copy update-evobackup-canary script"
copy:
src: 000-update-evobackup-canary
dest: /usr/share/scripts/000-update-evobackup-canary
owner: root
group: wheel
mode: "0755"
force: true
tags:
- evobackup
- name: "Fetch daily.local content"
command: 'grep "sh /usr/share/scripts/zzz_evobackup" /etc/daily.local'
check_mode: false
@ -29,8 +40,7 @@
mode: "0600"
create: true
when:
- not (daily_local_content.stdout
| regex_search('sh /usr/share/scripts/zzz_evobackup'))
- not (daily_local_content.stdout | regex_search('sh /usr/share/scripts/zzz_evobackup'))
tags:
- evobackup
@ -45,6 +55,17 @@
tags:
- evobackup
- name: "Add canary cron"
lineinfile:
path: /etc/daily.local
line: 'sh /usr/share/scripts/000-update-evobackup-canary'
insertafter: 'next_part "EvoBackup output:"'
owner: root
mode: "0600"
create: true
tags:
- evobackup
- name: "Delete legacy evobackup root crontab"
lineinfile:
path: /var/cron/tabs/root