mariadb: Add database backup cron job
This commit is contained in:
parent
6d8d7b7296
commit
f848891918
1 changed files with 32 additions and 0 deletions
|
@ -88,3 +88,35 @@
|
|||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
when: mariadb_root_password is defined
|
||||
|
||||
- name: create backup directory
|
||||
file:
|
||||
path: /export/backup
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: link backup directory
|
||||
file:
|
||||
path: /srv/backup
|
||||
src: /export/backup
|
||||
state: link
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
follow: false
|
||||
|
||||
- name: copy backup script
|
||||
copy:
|
||||
dest: /usr/local/sbin/mariadb-backup
|
||||
src: mariadb-backup.sh
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: create backup cron job
|
||||
cron:
|
||||
name: mariadb-backup
|
||||
job: /usr/loca/sbin/mariadb-backup
|
||||
hour: "0"
|
||||
minute: "30"
|
||||
|
|
Loading…
Add table
Reference in a new issue