The goal is to implement a backup solution independent of the service stack to quickly restore from a bakup in case of a total outage of the Pi drive / both server drives.
Requirements:
- Simplicity: The backup solution should use as little moving parts as possible in order for it to generate as little work as possible.
- Locality: The drive needs to be local. A remote solution is implemented / described in another issue.
- Security: The solution should give strong security guarantees. Access to the drive should be as minimal as possible and data should be pulled, not pushed, to improve hardening.
- Automation: The solution has to be fully automated to reduce manual toil.
Solution Proposal:
- A second external drive on the Raspberry Pi.
- Only a dedicated backup user can access the drive.
- The data transfer is initiated by the backup user to have a true pull solution.
- The job should be implemented with
systemd, not as a cron job, as systemd runs after a temporary outage of the Pi.
- The backup script should initiate a wol call to the server and power off the server once done. This power off should be preventable by activating a flag in Homeassistant. A solution for this is to simply create/delete a file when clicking a button in HA and checking for that files existance before initiating the poweroff.
- The filesystem of the external drive should be ZFS, such that only incremental data from the server needs to be sent over.
Backup Strategy:
- Do everything by hand, sending raw zfs snapshot data to the Pi. This could lead to faulty sends, requiring a full resend but it is the simplest solution.
- Use
syncoid to perform automated snapshot creation and syncing. It is a convenience feature but maybe overkill.
- Use
sanoid for automatic snapshot management. This is most likely overkill for the start.
The goal is to implement a backup solution independent of the service stack to quickly restore from a bakup in case of a total outage of the Pi drive / both server drives.
Requirements:
Solution Proposal:
systemd, not as a cron job, assystemdruns after a temporary outage of the Pi.Backup Strategy:
syncoidto perform automated snapshot creation and syncing. It is a convenience feature but maybe overkill.sanoidfor automatic snapshot management. This is most likely overkill for the start.