### Added - File logging to `/var/log/ha-backup.log`. Each line has a full date and time, and the file is appended to on every run. - New `LOG_FILE` setting in `home_assistant_backup.conf`. Set it to a custom path, or to `"none"` to disable file logging. - `ssh`/`scp` error output is also written to the log file. - Deletions of old local backups are now logged. ### Changed - All console messages now go through the same logger, so remote cleanup, notification failures and config validation errors appear in the log too. - If the log file can't be opened (for example, no write permission to `/var/log`), a warning is printed and the backup continues without file logging. - The terminal progress bar stays on the console only and is not written to the log.
39 lines
1.8 KiB
Plaintext
39 lines
1.8 KiB
Plaintext
### Global Settings ###
|
|
# Set your Home Assistant SSH credentials
|
|
HA_SSH_KEY="SSH_PRIVATE_KEY" # Replace with your SSH Private key for HomeAssistant
|
|
HA_SSH_USER="SSH_USER" # Replace with your HomeAssistant server username (Default is root)
|
|
HA_SSH_HOST="SSH_HOST_IP_OR_HOSTNAME" # Replace with your HomeAssistant server IP address
|
|
HA_SSH_PORT="SSH_PORT" # Replace with your HomeAssistant server port
|
|
|
|
## Storage
|
|
# Set the backup destination path
|
|
BACKUP_DEST="BACKUP_FILE_DESTINATION" # Replace with the location for the backup files
|
|
|
|
# Set the location of the Home Assistant backups (Set to default location /backup)
|
|
# If you have a custom install, using the likes of Supervised
|
|
# this location should normally be /usr/share/hassio/backup
|
|
BACKUP_FILE_LOCATION="/backup"
|
|
|
|
# Storage threshold (in KB) for triggering cleanup
|
|
STORAGE_THRESHOLD_KB=2097152 # 2GB = 2 * 1024 * 1024 KB
|
|
# Set clean up old backups (adjust the number of days to keep)
|
|
LOCAL_BACKUP_CLEANUP="90" # Set the number of days that local backup files will be kept for (Default 90 days)
|
|
REMOTE_BACKUP_CLEANUP="30" # Set the number of days that backups on the Home Assistant server will be kept for (Default 30 days)
|
|
|
|
## Notification Settings
|
|
# ntfy settings
|
|
NTFY_ENABLED=false # Set to 'true' to enable ntfy notifications
|
|
NTFY_SERVER="NTFY_SERVER_FQDN_ADDRESS" # Replace with your ntfy server address
|
|
NTFY_TOPIC="NTFY_TOPIC" # Replace with your ntfy topic
|
|
|
|
# Discord webhook settings
|
|
DISCORD_ENABLED=false # Set to 'true' to enable Discord notifications
|
|
DISCORD_WEBHOOK_URL="DISCORD_WEBHOOK_URL" # Replace with your Discord webhook URL
|
|
|
|
|
|
## Logging
|
|
# Set the log file location (Default /var/log/ha-backup.log)
|
|
# The file must be writable by the user running ha-backup, see the README
|
|
# Set to "none" to disable logging to a file (console output is unaffected)
|
|
LOG_FILE="/var/log/ha-backup.log"
|