Tool for work with Home Assistant Backup
Install
Way 1 - Download by bash (for Linux and MacOS)
wget -qO- https://github.com/librun/ha-backup-tool/releases/latest/download/ha-backup-tool-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m).tar.gz | tar -xz
Way 2 - Download binary (for Linux, MacOS, Windows)
Open link choose you OS & platrom and download file
Unpack file and use
Way 3 - Build yourself (for All)
run comand:
go install github.com/librun/ha-backup-tool@latest
Use
NAME
ha-backup-tool - Home Assistant Tool for work with backup
SYNOPSIS
ha-backup-tool
[--emergency|-e]=[value]
[--max-archive-size]=[value]
[--password|-p]=[value]
[--verbose]
Usage:
ha-backup-tool [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...]
GLOBAL OPTIONS
--emergency, -e="": Filepath for emergency text file
--max-archive-size="": Max size for extract archive (default size 500GB)
--password, -p="": Password for decrypt backup
--verbose: Verbose mode for output more information
COMMANDS
command for decrypt and extract one or more backups
⚠ If you are using Windows OS: For correct work with symlinks and hard links you must run this command with administrator rights or change Policy management from this article
Usage:
ha-backup-tool extract [command [command options]] files for extract backup home assistant in tar format
OPTIONS
--exclude, --ec="": Exclude files (split value by ,)
--include, --ic="": Include files (split value by ,)
--output, -o="": Directory for unpack files
--skip-create-links: Skip create symlinks and hard links
Example
Extract N archives by password to same location current files
ha-backup-tool extract -p XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX dir1/backup1.tar dir2/backup2.tar dir3/backupN.tar
Extract N archives by emergency file to different location dir
ha-backup-tool extract -e dir/emergency_file.txt -o dir/extract_backup dir1/backup1.tar dir2/backup2.tar dir3/backupN.tar
Extract only media archive:
ha-backup-tool extract -e dir/emergency_file.txt -ic media.tar.gz dir1/backup1.tar
Extract media and share archive:
ha-backup-tool extract -e dir/emergency_file.txt -ic media*,share* dir1/backup1.tar
extract archive whose file name starts with core:
ha-backup-tool extract -e dir/emergency_file.txt -ic core* dir1/backup1.tar
Extract archive whose file name have influxdb
ha-backup-tool extract -e dir/emergency_file.txt -ic *influxdb* dir1/backup1.tar
extract archive whose file name starts with core and exclude archive whose file name end with server.tar.gz
ha-backup-tool extract -e dir/emergency_file.txt -ic core* -ec *server.tar.gz dir1/backup1.tar
Shell Completions
For install completions run command
ha-backup-tool completion --help
And read and run instruction