Add fsfreeze support for QEMU/KVM/Proxmox installations (#2781)

* Add fsfreeze support for QEMU/KVM/Proxmox installations

Add fsfreeze scripts which calls the new Supervisor API to freeze Home
Assistant Core and add-ons which support the backup freeze scripts
(`backup_pre` and `backup_post`).

This allows to create safe snapshots with databases running.

* Fix lint issues
This commit is contained in:
Stefan Agner 2023-10-02 08:30:20 +02:00 committed by GitHub
parent a72c6c0322
commit 893a49a3f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=/usr/libexec/qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 --fsfreeze-hook /usr/libexec/haos-freeze-hook

View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
action="$1"
if [ "${action}" = "freeze" ]; then
echo "File system freeze requested, freezing Home Assistant"
ha backups freeze
elif [ "${action}" = "thaw" ]; then
echo "File system thaw requested, thawing Home Assistant"
ha backups thaw
else
echo "Unknown action ${action}"
fi