Update to 2022-08-30 23:00

This commit is contained in:
Daniel Berteaud 2022-08-30 23:00:16 +02:00
parent 2bb38da306
commit f460decd9b
3 changed files with 33 additions and 0 deletions

View File

@ -42,3 +42,10 @@
systemd: daemon_reload=True
when: linctl_unit.changed or (linctl_data_unit is defined and linctl_data_unit.changed)
tags: drbd
- name: Install backup hooks
template: src={{ item }}-backup.j2 dest=/etc/backup/{{ item }}.d/linstor mode=755
loop:
- pre
- post
tags: drbd

View File

@ -0,0 +1,8 @@
#!/bin/bash
set -eo pipefail
if [[ -e /home/lbkp/linstor/linstor_backup.zip ]]; then
echo Removing Linstor DB dump /home/lbkp/linstor/linstor_backup.zip
rm -f /home/lbkp/linstor/linstor_backup.zip
fi

View File

@ -0,0 +1,18 @@
#!/bin/bash
set -eo pipefail
mkdir -p /home/lbkp/linstor/
{% if linctl_ha %}
# Check we are the current active node. Else, just skip the backup
if [[ ! -e /var/lib/linstor/linstordb.mv.db ]]; then
echo Linstor DB not available on this node, skipping backup
exit 0
fi
{% endif %}
echo Dumping linstor DB dump
linstor controller backupdb linstor_backup
echo Moving dump to /home/lbkp/linstor/linstor_backup.zip
mv /var/lib/linstor/linstor_backup.zip /home/lbkp/linstor/