Samba Backup: Create and store backups on a Samba share

Hi there,
is there a chance to move the “storage pre check” to the start time of the backup and not the start of the addon?

I’m using one of my NAS for backups, wich is powered on for this purpose only (once a week(end)).
every time I restart/reload HA during the week (updates/upgrades/changes) the backup fails afterwards since the NAS is not available during Samba Backup startup. But it’s not needed at that point.

it would be great to get a warning only if the config couldn’t verified due to missing storage target but the AddOn starts anyway and shows errors if the target is still not available when the backup really starts.

and an automatic WoL command to the NAS (for my old, extremely slow NAS at least 10 minutes in advance) would be nice, but can archived by an extra automation.

a schedule for retries if a backup fails (due to target unavailable) would be a great feature as well

Hi all,
I would like to know

  1. how to work with encrypted backup (via backup password ) is there any way how to open homeassistant.tar file in the compressed encrypted file and grab a short excerpt from config to work with it?
  2. how to restore HA from the encrypted backup?

Yeah there is. Search the forum, someone created a Python script to decrypt them.

My advice would be to avoid password protection though. Makes actually using your backups more difficult than it needs to be.

Unless you are storing your backups somewhere public (which IMO is an even worse idea).

Hi all,
i use healthckeks.io to keep track of my backup job execution, and in case one backup fail it send me a notification. It would be great to add to Samba Backup, the ability to run a script at start and at the end of backup, in order to ping healthchecks.io via its API.

Thanks

Confimed, this does the trick for me!!

Hello,

looks like that after a few days, the backups stop working and revert either to the stock config or an old config I made in the beginning, but only regarding the scheduled time :

They start at 4am, but my NAS is off at that time :

The config :

I noticed the backups stop, and the addon has a red icon and needs a restart.
After restarting, backups are starting to work again at 23h00 :

Any idea ?
Thanks :slight_smile:

Once again, the addon stopped working after suddenly trying to run at 4am instead of 11pm :



Looks like the watchdog is also not doing its job

edit : looks like it fails every sunday, investigating.

I have an auto reboot running every sunday at 4am

edit2 : is this the solution ?? hassio-addons/samba-backup/DOCS.md at 373b8c5ca49e54e2355e9b8f167fed0b25ac1ffe · thomasmauerer/hassio-addons · GitHub
edit3 : no looks like it’s unrelated to my issue

Another week, another reboot, another error :frowning:


Exact same behavior.
Looks like the Watchdog is not working.

edit :
I created this automation as a workaround :

alias: Samba Backup Fix
description: Starts the samba backup service
trigger:
  - platform: time
    at: "05:00:00"
condition: []
action:
  - action: hassio.addon_start
    metadata: {}
    data:
      addon: 15d21743_samba_backup
mode: single

I don’t like this as a solution, but I’m out of ideas.

Hi,

Thank you for this great add-on. I jut miss 1 thing, being able to snapshot/backup instantly from the add-on (settings) screen. Whenever i need an instant snapshot i now have to change the time of the backup to 2-3 minutes in the future to force the backup and wait for it to happen. It would be nicer to have a button to force a backup straight away. You might wonder why? Well, whenever you wish to install/update critical stuff you would want an instant update/snapshot before and after installing and configuring.

Maybe you could add this?

Thank you.

There is an action to start a backup right away. I have this script for example:

backup_to_nas:
  alias: Backup to NAS
  mode: single
  sequence:
    - action: hassio.addon_stdin
      data:
        addon: 15d21743_samba_backup
        input: trigger

Then add the script entity to the dashboard

1 Like

I just have a button card for that on my dashboard…

type: button
name: Manual Samba Backup
icon: mdi:database
show_name: true
show_icon: true
tap_action:
  action: perform-action
  perform_action: hassio.addon_stdin
show_state: true

I have been running Samba backup with no issues for about 6 months and it suddenly stopped about 3 weeks ago. Running version 5.2.0. The log states that it cannot access the share for some reason. Not sure what changed to cause this.
The share is a folder on my PC.

cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[24-09-15 18:33:16] INFO: ---------------------------------------------------
[24-09-15 18:33:16] INFO: Host/Share: 192.168.19.121/HA Backup
[24-09-15 18:33:16] INFO: Target directory: Backup
[24-09-15 18:33:16] INFO: Keep local/remote: 14/60
[24-09-15 18:33:16] INFO: Trigger time: 05:00
[24-09-15 18:33:16] INFO: Trigger days: Mon
[24-09-15 18:33:16] INFO: ---------------------------------------------------
[24-09-15 18:33:17] DEBUG: Backups local/remote: 15/26
[24-09-15 18:33:17] DEBUG: Total backups succeeded/failed: 26/2
[24-09-15 18:33:17] DEBUG: Last backup: 2024-08-19 05:01
[24-09-15 18:33:22] WARNING: do_connect: Connection to 192.168.19.121 failed (Error NT_STATUS_IO_TIMEOUT)
[24-09-15 18:33:22] FATAL: Cannot access share. Unknown reason.
[24-09-15 18:33:22] DEBUG: Posting sensor data to API at /core/api/states/sensor.samba_backup
[24-09-15 18:33:22] DEBUG: API Status: 200
[24-09-15 18:33:22] DEBUG: API Response: {“entity_id”:“sensor.samba_backup”,“state”:“FAILED”,“attributes”:{“friendly_name”:“Samba Backup”,“backups_local”:“15”,“backups_remote”:“26”,“total_backups_succeeded”:“26”,“total_backups_failed”:“2”,“last_backup”:“2024-08-19 05:01”},“last_changed”:“2024-09-15T22:27:39.611642+00:00”,“last_reported”:“2024-09-15T22:27:39.611642+00:00”,“last_updated”:“2024-09-15T22:27:39.611642+00:00”,“context”:{“id”:“01J7VWRZEVSBTPS1NCQQ50GKMP”,“parent_id”:null,“user_id”:“a023d812f7b54e369742ad35bde838b7”}}

s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Maybe a Windows update caused this?

Check whether the share is really still avaiable to Samba Backup. I would fully remove that share from the PC and recreate it.

1 Like

Yes, I am thinking a windows update caused it. Running WIN10.

Doing a little more digging, I found that SMBv1 was disabled in Windows. I had to go into the control panel to re-enable it and Samba Backup is working again now.

Will MS keep disabling SMBv1 with their updates?

No idea whether this will happen again with MS-updates. However, it’s a simple one-liner to re-enable SMBv1 when using Power Shell.

To check whether SMBv1 is enabled/disabled run from PowerShell:
Get-SmbServerConfiguration | Format-List EnableSMB1Protocol

To re-enable SMBv1 run as Administrator from PowerShell:
Set-SmbServerConfiguration -EnableSMB1Protocol $true

and you should be good again.

1 Like

Dear all,

I experience an issue together with an attached Network-Storage.

The samba-backup is working fine, but after creation, the file is no longer found by the addon, but it is stored on the external device.

How can I get the samba backup addon to “see” the stored files and delete them after the storage time is over?

2 Likes

I experienced a similar issue, but backups are not created locally and not saved to NAS for me, manually triggering with above script it works for both.

So it seems the trigger days are no longer working. Once removed the existing trigger days I cannot add them back.

Later found out that the original/default trigger short day names are no longer accepted: Mon, Tue, Wed, Thu, Fri, Sat, Sun

However it works with full day names: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday

Env details:
Add-on version: 5.2.0
You are running the latest version of this add-on.
System: Home Assistant OS 13.1 (amd64 / generic-x86-64)
Home Assistant Core: 2024.9.2
Home Assistant Supervisor: 2024.09.1

Hi,

try checking the default backup location under http://homeassistant.local:8123/hassio/backups
→ Menu in the upper right and “change default backup location”.

Backup will break, if this is set to the SMB location.

It worked for me, after changing it back to local storage.

I run HA on unraid(xeon gold 5118 12 cores and 64G mem) and my virtual disk is over 1TB and I wanted to shrink it. easiest way I thought was to install new HA instance and restore last nights backup file.

The backup file is 200G

I tried the HA onboarding process and pointed it at the backup file but after 20 hours of “restore in progress” nothing happended.

So I created a new HA user, added samba backup addon and tried the restore process. The 200G backup file was discovered locally in the backup/config folder so I started the restore process. The HA gui connection dropped but 3 hours later … no gui acess. I can ping the server nd HA cli interface is up.

How long should the restore process take and is there anyway to see if the restore process is still active?

I have this addon running perfectly fine on one HA instance and yet, when trying to get it running on another one, I can’t even save the samba backup configuration file even though I copy/paste a perfectly working config file from my other instance.

I hit save then I get the error:

Failed to save add-on configuration, Unknown error, see supervisor logs

there is nothign related in the supervisor logs, perhaps only this one line:

2024-10-02 17:25:41.729 WARNING (MainThread) [supervisor.utils.pwned] Can't fetch HIBP data: Timeout

The HA core logs however show this timeout:

Log Details (ERROR)
Logger: homeassistant.components.hassio.handler
Source: components/hassio/handler.py:615
integration: Home Assistant Supervisor (documentation, issues)
First occurred: 16:20:56 (3 occurrences)
Last logged: 16:34:13

Timeout on /addons/15d21743_samba_backup/options/validate request

Any ideas? The only issue similar to mine is this, where someone said he gets the same error when HA is offline, which is not the case with mine, as I am remotely conencted to it.

And then someoen saying he cannot save a configuration due to HIBP check: Addon UI Configuration not possible due to HIBP check · Issue #4441 · home-assistant/supervisor · GitHub

Please help.