Examples
Send a notification on backup failure#
Blueprint
Send notifications based on events created by the Auto Backup integration, such as when a backup fails.
Notify on Backup Failure
- alias: "Notify Backup Failure"
trigger:
platform: event
event_type: auto_backup.backup_failed # (1)
action:
service: persistent_notification.create # (2)
data:
title: "Backup Failed."
message: |-
Name: {{ trigger.event.data.name }}
Error: {{ trigger.event.data.error }}
- We listen for the
auto_backup.backup_failed
event. - Create a persistent notification on failure with the backups name and the error.
Scheduling automatic backups#
Blueprint
Create backups each day and keep them for a configurable amount of time, backups are stored less frequently the older they are.
Perform a partial backup of the Home Assistant config folder, mariadb and mosquitto every 3 hours, and store each backup for 2 days.
Automatic Backups
- alias: Automatic Backup
trigger: # (1)
- platform: time_pattern
hours: "/3"
action:
- service: auto_backup.backup_partial
data:
name: "AutoBackup: {{ now().strftime('%a, %-I:%M %p (%d/%m/%Y)') }}"
addons:
- almond
- Glances
- mosquitto broker
- core_mariadb
folders:
- homeassistant
- Share
- ssl
- Local add-ons
keep_days: 2
- Automation triggers on every 3rd hour.
Excluding addons/folders from a backup#
Exclude from Backup
- alias: Perform Daily Backup
trigger:
- platform: time
at: "00:00:00"
action:
- service: auto_backup.backup_full
data:
name: "DailyBackup: {{ now().strftime('%A, %B %-d, %Y') }}"
keep_days: 7
exclude:
addons:
- Portainer
folders:
- Local add-ons
- share