Samba Backup: Create and store backups on a Samba share

Does this add-on support DNS because I’m having issues where if I point the add-on to my nas via fqdn, it does not work. However if I go by IP then it does work. I would assume it should use dns settings from HA itself which works just fine.

# nslookup mynas1.home
Server:      192.168.1.1
Address:   192.168.1.1:53

Name:  mynas1.home
Address: 192.168.53.11

But if plugged into the add-on I get this error

[22-07-02 13:57:47] WARNING: do_connect: Connection to mynas1.home failed (Error NT_STATUS_UNSUCCESSFUL)
[22-07-02 13:57:47] FATAL: Cannot access share. Unknown reason.

If I use the IP instead, it works fine.

Any insight?

Never mind now it works :slight_smile:

:warning:

After updating the addon and manually setting the log level (to warning) the daily backups still (this was already the case before updating to v5.1.0!) don’t contain InfluxDB addon - that’s not a full backup.

What’s wrong with it? The configuration did not change besides the log level setting.


Update: Fixed by restarting all involved addons including HA.

Feature Request:

Can we have the size of the last created backup as attribute of the samba backup sensor? This way one can monitor the backup („if last backup size < x.x GB, then send notification“).

I accidentally dropped a question mark in the schema which makes the log level now a required parameter. Issue is fixed in v5.1.1.

I can access correctly from windows 11 and 10 :slight_smile: so is updated.
I’ll try the ip, good suggestion

Don’t know if somebody mentioned already as I could not find the answer yet. Before updating to version 5.1.0. and now 5.1.1 I had a backup file of 150 - 200MB, now with the new version my file is 11GB altough I have excluded the media and backup directories from the backup?

It seem that the media is backuped anyway?

Can we @thomasmauerer ? What do you think?

I have a problem syncing to hetzner storagecloud. SMB/CIFS is enabled in hetzner and SMB1 is disabled according to smbclient.

My config:

host: xxx.your-storagebox.de
share: backup
target_dir: backups/ha-backups/
username: xxx
password: xxx
keep_local: all
keep_remote: all
trigger_time: '04:00'
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []

error log from addon:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Samba Backup
 Create backups and store them on a Samba share
-----------------------------------------------------------
 Add-on version: 5.1.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 8.2  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2022.7.5
 Home Assistant Supervisor: 2022.07.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
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
[22-07-15 15:35:36] INFO: ---------------------------------------------------
[22-07-15 15:35:36] INFO: Host/Share: xxx.your-storagebox.de/backup
[22-07-15 15:35:36] INFO: Target directory: backups/ha-backups/
[22-07-15 15:35:36] INFO: Keep local/remote: all/all
[22-07-15 15:35:36] INFO: Trigger time: 04:00
[22-07-15 15:35:36] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[22-07-15 15:35:36] INFO: ---------------------------------------------------
[22-07-15 15:35:42] WARNING: do_connect: Connection to xxx.your-storagebox.de failed (Error NT_STATUS_IO_TIMEOUT)
[22-07-15 15:35:42] FATAL: Cannot access share. Unknown reason.
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

I searched github and this thread but couldn’t find a solution. I tried setting the ipv4 address in config, but still same problem. I can connect from my local computer and remote server.

❯ smbclient //xxx.your-storagebox.de/backup -U xxx
Can't load /etc/samba/smb.conf - run testparm to debug it
Password for [WORKGROUP\xxx]:
Try "help" to get a list of possible commands.
smb: \> cd backups/ha-backups
smb: \backups\ha-backups\>

I have also problem with io timeout. I’m storing it on usb on my fritz box. Didnt find a solution. Once i managed to copy two backup files on my usb stick but when I tried other day i got again io timeout.
My backup file is over 2 gb.

Hi, I’m trying to resolve NT_STATUS_IO_TIMEOUT error.
I got an idea to try to add some lines in nginx conf file just to see will it work. This is what I got

location /192.168.178.1/ {
        proxy_connect_timeout 3600;
        proxy_send_timeout 3600;
        proxy_read_timeout 3600;
    }

When I triggered backup I saw this line in my nginx log

[error] 134#134: *3061 client intended to send too large body: 139100726 bytes,

So I added a line in my nginx conf file

client_max_body_size 2500M;

but I got the same error again but this time nginx wasnt complaining.
This is error from samba backup addon running in debug mode.

[22-07-17 18:20:55] WARNING: cli_push returned NT_STATUS_IO_TIMEOUT
NT_STATUS_CONNECTION_DISCONNECTED closing remote file \USB_BACKUP\ha-backup\Samba_Backup_2022_07_17_18_02.tar
[22-07-17 18:20:55] WARNING: Could not copy backup 94e0220c to share. Trying again ...
[22-07-17 18:21:20] WARNING: protocol negotiation failed: NT_STATUS_IO_TIMEOUT
[22-07-17 18:21:30] DEBUG: API Status: 200
[22-07-17 18:21:30] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"FAILED","attributes":{"friendly_name":"Samba Backup","backups_local":"1","backups_remote":"12","total_backups_succeeded":"0","total_backups_failed":"17","last_backup":"never"},"last_changed":"2022-07-17T16:21:30.811099+00:00","last_updated":"2022-07-17T16:21:30.811099+00:00","context":{"id":"01G86FE0HVZRHW6XPPKFZ25158","parent_id":null,"user_id":"d0dd944b2f65447b8e6726d82ca192e5"}}
[22-07-17 18:21:40] DEBUG: API Status: 200
[22-07-17 18:21:40] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"IDLE","attributes":{"friendly_name":"Samba Backup","backups_local":"1","backups_remote":"12","total_backups_succeeded":"0","total_backups_failed":"17","last_backup":"never"},"last_changed":"2022-07-17T16:21:40.860463+00:00","last_updated":"2022-07-17T16:21:40.860463+00:00","context":{"id":"01G86FEABWDN4YPF6BXEYP1TS2","parent_id":null,"user_id":"d0dd944b2f65447b8e6726d82ca192e5"}}

I was able to pull two backups on my usb stick connected to fritz box router. This is what I done.
In nginx config file I added line

 }
    location /192.168.178.1/ {
        proxy_connect_timeout   7200;
        proxy_send_timeout   7200;
        proxy_read_timeout   7200;
        client_max_body_size   2500M;
    }

On my cisco router that connects my local router with my wan router I changed default session timeout settings to

TCP Timeout: 7200
UDP Timeout: 240

Backup file has 1.68 GB and it does throw an error while copying it but it does copy the file. This is debug log from addon.

[22-07-21 00:08:43] INFO: Copying backup 99a9502f (Samba_Backup_2022_07_21_00_00.tar) to share
[22-07-21 00:29:57] WARNING: cli_push returned NT_STATUS_IO_TIMEOUT
NT_STATUS_CONNECTION_DISCONNECTED closing remote file \USB_BACKUP\ha-backup\Samba_Backup_2022_07_21_00_00.tar
[22-07-21 00:29:57] WARNING: Could not copy backup 99a9502f to share. Trying again ...
[22-07-21 01:35:49] DEBUG: putting file 99a9502f.tar as \USB_BACKUP\ha-backup\Samba_Backup_2022_07_21_00_00.tar (444.5 kb/s) (average 444.5 kb/s)
[22-07-21 01:35:49] DEBUG: {"date":"2022-07-20T22:00:09.976962+00:00","slug":"99a9502f","name":"Samba Backup 2022-07-21 00:00"}
[22-07-21 01:35:49] INFO: Deleting 99a9502f (Samba Backup 2022-07-21 00:00) local
[22-07-21 01:35:49] DEBUG: Command completed successfully.
[22-07-21 01:35:51] DEBUG: API Status: 200
[22-07-21 01:35:51] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"SUCCEEDED","attributes":{"friendly_name":"Samba Backup","backups_local":"1","backups_remote":"4","total_backups_succeeded":"2","total_backups_failed":"24","last_backup":"2022-07-21 01:35"},"last_changed":"2022-07-20T23:35:51.451700+00:00","last_updated":"2022-07-20T23:35:51.451700+00:00","context":{"id":"01G8EZFFCVVNJRD4WCPAF27EM0","parent_id":null,"user_id":"d0dd944b2f65447b8e6726d82ca192e5"}}
[22-07-21 01:36:01] DEBUG: API Status: 200
[22-07-21 01:36:01] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"IDLE","attributes":{"friendly_name":"Samba Backup","backups_local":"1","backups_remote":"4","total_backups_succeeded":"2","total_backups_failed":"24","last_backup":"2022-07-21 01:35"},"last_changed":"2022-07-20T23:36:01.508586+00:00","last_updated":"2022-07-20T23:36:01.508586+00:00","context":{"id":"01G8EZFS74CKVTQ5HYCP52Q94M","parent_id":null,"user_id":"d0dd944b2f65447b8e6726d82ca192e5"}}
[22-07-21 01:36:01] INFO: Backup finished

I think that this problem is somehow network related.

Great addon!

I just have 2 questions.

  1. So I’m trying to put a custom icon for the sensor.samba_backup entity through configuration.yaml and it’s not working. The icon doesn’t change on the front-end. Am I missing something?

  2. Sometimes the sensor itself just disappears. Like now, I just updated HA to 2022.8 and the sensor itself is gone. I’m pretty sure if I restart the addon it’ll come back. Is this a known bug?

Thanks for the great work btw, the actual backups work beautifully.

Hey here
I have problem with getting a connection The error i get is as follows:

Info
Documentation
Configuration
Log
Samba Backup
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Samba Backup
 Create backups and store them on a Samba share
-----------------------------------------------------------
 Add-on version: 5.1.1
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (amd64 / qemux86-64)
 Home Assistant Core: 2022.8.6
 Home Assistant Supervisor: 2022.08.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
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
[22-08-19 22:22:49] INFO: ---------------------------------------------------
[22-08-19 22:22:49] INFO: Host/Share: 192.168.178.150/Lee
[22-08-19 22:22:49] INFO: Target directory: Server\Homeassistant\Backups
[22-08-19 22:22:49] INFO: Keep local/remote: 2/20
[22-08-19 22:22:49] INFO: Trigger time: 21:42
[22-08-19 22:22:49] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[22-08-19 22:22:49] INFO: ---------------------------------------------------
[22-08-19 22:22:52] WARNING: do_connect: Connection to 192.168.178.150 failed (Error NT_STATUS_HOST_UNREACHABLE)
[22-08-19 22:22:52] FATAL: The provided host is unreachable. Please check your config and network.
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

and my congfig is set as:

host: 192.168.178.150
share: Lee
target_dir: Server\Homeassistant\Backups
username: lee
password: **********(blacked out on purpose)
keep_local: "2"
keep_remote: "31"
trigger_time: "00:00"
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []

I can access the folder i want to backup to go in with windows no problem.

The first thing I would do, is to change the Windows „\“ into the correct „/“.

Host is unreachable. You somehow miss configured addon.

Tryed that did not work and the error is the same

host: 192.168.178.150
share: Lee
target_dir: Server/Homeassistant/Backups
username: lee
password: ***********
keep_local: "2"
keep_remote: "20"
trigger_time: "21:42"
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []

Tryed that didnt work

host: 192.168.178.150
share: Lee
target_dir: Server/Homeassistant/Backups
username: lee
password: *********
keep_local: "2"
keep_remote: "20"
trigger_time: "21:42"
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []

are you sure your share is Lee/Server/something

the share is just called Lee
the folder i want the backup is Server/Homeassistant/Backups