# Home Assistant Backup Automation Scripts These scripts automate the backup process for **Home Assistant** servers, enabling you to create, transfer, and manage backups. The backups are securely transferred from the Home Assistant server to your local machine, with options for cleaning up old backups based on configurable retention periods. ## Overview ### Features: - **Backup Creation**: Automates the process of creating backups on your Home Assistant server. - **Backup Transfer**: Transfers the generated backups to a local machine for safekeeping. - **Old Backup Cleanup**: Automatically cleans up old backups on both the Home Assistant server and local machine after a specified retention period. - **Notification Support** (Optional): Configure **ntfy** or **Discord** notifications to alert you about the backup status (available in the first script version). ### Three Versions of the Script: 1. **Version 1** A simpler version that creates a backup, copies it to your local machine, and performs a basic cleanup of old backups locally. No notification system is included in this version. 2. **Version 2** This version includes backup creation, local and remote cleanup of old backups, and optional notifications via **ntfy** and **Discord**. It also checks for available disk space before cleaning up old backups. 3. **Version 3 (RECOMMENDED)** This version continues on from 2.0.1 but it has now been ported to Go and has a Go binary ## Requirements Both scripts require the following to function correctly: - **Bash shell** (on your local machine and Home Assistant server) - **SSH** access to the Home Assistant server - **`scp`** and **`ssh`** tools - **Home Assistant** installed on the server with the `ha` CLI tool - **Optional**: Access to a notification service (for Version 2&3) ## Configuration Each version has different configuration files ## Disclaimer **The software is provided "as-is" without any warranties or guarantees of any kind.** By using this script, you acknowledge and agree that: - **No Warranty**: The script is provided without any warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of the use or performance of the script remains with you. - **Data Loss**: The author cannot be held responsible for any data loss, damage to your system, or any other kind of loss resulting from the use of this script. You are solely responsible for backing up your data and ensuring the integrity of your systems before using the script. - **Use at Your Own Risk**: You are using this script at your own risk. The author shall not be liable for any damages, including but not limited to direct, indirect, incidental, special, consequential, or punitive damages, arising out of the use of or inability to use the script. - **No Support**: The script is provided "as-is" with no formal support or maintenance. The author does not provide any guarantees of continued functionality, updates, or support. - **Modifications and Redistribution**: If you modify or redistribute the script, you do so at your own risk. You are solely responsible for ensuring that any modifications or redistributed versions do not cause harm or violate any laws. By using or modifying this script, you agree to indemnify and hold harmless the author from any and all claims, damages, liabilities, and expenses arising from your use or modification of the script. --- Use of this project is subject to the terms above. If you do not agree with this disclaimer, you should not use it.