thomasmauerer / hassio-addons

My collection of addons for Home Assistant
MIT License
466 stars 54 forks source link

Samba backup does not start if target device is offline and stops making backups until manually started #148

Closed jbogers closed 1 year ago

jbogers commented 1 year ago

Samba backup does not start if target device is offline. This is problematic, for example if the target device is restarted at the same time as the Home Assistant device and Home Assistant starts up faster then the target device makes the SMB share available. This could, for example, happen if there is a power failure that affects both devices.

Relevant log (redacted):

WARNING: do_connect: Connection to REDACTED failed (Error NT_STATUS_HOST_UNREACHABLE)
FATAL: The provided host is unreachable. Please check your config and network.

This makes it possible for the backup process to be silently disabled. Instead, it would be desirable that samba backup would still (try to) run the backup tasks according to the backup schedule, especially if it was started after a system reboot/powerup.

thomasmauerer commented 1 year ago

That's how it's supposed to work. If you know what you are doing, you can use the skip_precheck option. With this the addon will not shut down. --> https://github.com/thomasmauerer/hassio-addons/blob/master/samba-backup/DOCS.md#option-skip_precheck

Midbin commented 1 year ago

Would it maybe be possible to have a persistent notification or some other notification, if the addon shuts down due to an error? As I wrote in #149 I found it to be surprising to have the addon silently failing and not running.

thomasmauerer commented 1 year ago

The addon provides a sensor --> https://github.com/thomasmauerer/hassio-addons/blob/master/samba-backup/DOCS.md#home-assistant-sensor

If the checks during startup fail, the state will also switch to FAILED. You can use that in an automation for instance.