ianadd
(ian)
December 23, 2021, 5:57am
1
How can I detect when a backup completes?
backup:
sequence:
- service: hassio.backup_full
data_template:
name: Full Backup {{ now().strftime('%Y-%m-%d') }}
I want to know it has completed before the next step. Is it possible to know ?
philb
(Philip Bowers)
December 28, 2021, 10:36am
2
Configuration tab
Add-ons, Backups & Supervisor
Backups
philb
(Philip Bowers)
December 28, 2021, 10:43am
3
Here’s a copy of my automation for weekly backups.
alias: HASSIO Weekly Snapshot
trigger:
- platform: time
at: 03:00:00
condition:
condition: time
weekday:
- sun
action:
- service: hassio.backup_full
data:
name: Full Backup {{ now().strftime('%Y-%m-%d') }}
ianadd
(ian)
December 28, 2021, 11:04am
4
@philb My automation is virtually identical. That is not my issue.
I want to know when the backup completes.
Eg to be able to report how long it took, or to copy the backup file to another location…
philb
(Philip Bowers)
December 28, 2021, 7:39pm
5
That was my second post. Refer to my first post about where to find the HA backups.
Configurations
Add-ons, Backups, Supervisor
Backup (Different on phone than PC but, the option that says backup or looks like the icon here.)
ianadd
(ian)
December 29, 2021, 10:21am
6
Perhaps this will make it clearer.
I want the first script call to wait until the backup completes before returning and allowing the next step.
It does not, it just initiates the backup and exits.
philb
(Philip Bowers)
December 30, 2021, 11:03am
7
It’s not the “wait for a triggered event solution” but, there is always the delay.
backup:
sequence:
- service: script.do_full_backup
- delay: "00:10:00"
- service: script.copy_backup_to_dropbox
- service: notify.pushover
data:
title: 0z HA-250G
message: HA Clone back-up done
mode: single
Edit:
Apparently, this has been a request sense 2018. Trigger a event when snapshot creation is finished
Here is a 2020 request. Feature Request: Snapshot complete event
But I was not able to find it on the official Feature Requests sight.
ianadd
(ian)
December 30, 2021, 9:35pm
8
That has been my inelegant solution to date.
There must be a way to know a hassio service has finished.
ianadd
(ian)
January 3, 2022, 3:40am
9
@philb thanks for that bit of research. I have created a feature request.
1 Like
3v1n0
(Marco Trevisan)
April 26, 2022, 7:35pm
10
In theory hassio suports this now Notify HA Core when backup is being executed by agners · Pull Request #3305 · home-assistant/supervisor · GitHub
Not sure if it has been implemented on the core-side though.
EDIT: not really, this is valid only for backups that include home-assistant only
mortee
March 20, 2023, 1:36am
11
Has this been solved somehow? I have the exact same issue, trying to do further processing when a HA backup is done and finished - but since the service call doesn’t wait for it to actually finish, I’m stuck.
Not a fix, but a workaround for anyone who runns across this thread in the future, the Google Drive Add-On exposes sensor.backup_state
, which has the attributes last_backup
and last_uploaded