Samba Backup: Create and store backups on a Samba share

I think that changed in 0.99: https://www.home-assistant.io/blog/2019/09/18/release-99/#hassio

Ok interesting. But then I think it should actually work out of the box without changes in the add-on itself. Iā€™ll check that out later.

I just tested it and it is working out of the box. Awesome, I did not know that!
If you get ā€œinvalid yaml syntaxā€, you probably have to enclose it in quotation marks:

username: '!secret your_user'
password: '!secret your_pass'
3 Likes

Not sure if you are aware but this is a good RSS feed to subscribe to: https://developers.home-assistant.io/blog/

1 Like

Hello, newbie having trouble setting this up correctlyā€¦

everything in log good untilā€¦

[21:50:27] FATAL: The provided host is unreachable. Please check your config.
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scriptsā€¦
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

This is my config:

host: 'homeasistant.local:8123'
share: backup
target_dir: HomeAssistant
username: xxxxx
password: 'xxxxxxx'
keep_local: '5'
keep_remote: '20'
trigger_time: '22:00'
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []

Any help pleaseā€¦

You need to specify the IP address of your NAS in the host field, not home assistant.

2 Likes

Samba Backup seems to be filling the supervisor log with a large number of warnings:

20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_nodered not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_thelounge not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_foldingathome not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_aircast not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_unifi not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_airsonos not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_mqtt not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on core_almond not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_matrix not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on f3248fb7_rtl4332mqtt not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on 15ef4d2f_esphome-dev not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on 243ffc37_ympd not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on core_tellstick not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_ftp not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on 243ffc37_icantbelieveitsnotvaletudo not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on core_configurator not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_chrony not found/installed
...etc
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on core_check_config not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_tautulli not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_phlex not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_appdaemon not found/installed
20-11-02 15:16:00 WARNING (MainThread) [supervisor.snapshots] Add-on a0d7b954_zerotier not found/installed
20-11-02 15:16:00 INFO (MainThread) [supervisor.snapshots] Snapshotting fd08f1da store Add-ons
20-11-02 15:16:00 INFO (MainThread) [supervisor.addons.addon] Building snapshot for add-on a0d7b954_glances
20-11-02 15:16:00 INFO (MainThread) [supervisor.addons.addon] Finish snapshot for addon a0d7b954_glances
20-11-02 15:16:00 INFO (MainThread) [supervisor.addons.addon] Building snapshot for add-on core_duckdns
20-11-02 15:16:00 INFO (MainThread) [supervisor.addons.addon] Finish snapshot for addon core_duckdns
20-11-02 15:16:00 INFO (MainThread) [supervisor.addons.addon] Building snapshot for add-on core_mariadb
20-11-02 15:17:09 INFO (MainThread) [supervisor.addons.addon] Finish snapshot for addon core_mariadb
...etc

Yes youā€™re right. The supervisor API slightly changed which now requires a small adaption in this add-on. I will fix that in v4.2.

1 Like

Thanks! Iā€™ll go try that now!

Tom, question about your implementation of access to a Samba share. The ā€œSamba Shareā€ add-on allows sharing local drive resources from HaaOS and mounting it on another device (like my Synology NAS) yet I have not found an add-on that would allow me to mount a Synology share on HassOS (which would be useful for things like access to media, storing video or snapshots from IP cameras, etc. without tying up RPi storage). However, your add-on is clearly doing what I need - accessing a share from my NAS. How are you doing that? Is it something that could be used in another add-on or manually to mount a NAS share on HaaOS?

I suspect the answer is that this works for your backup add-on because you just need the remote share mounted long enough to write a snapshot and yet it isnā€™t a mount that would persist across reboots, etc. but just thought I would ask.

It worked perfectly! BTW, thanks a ton for this add-onā€¦ it works great!

Happy to hear that :smiley:

Mounting a remote share inside a docker container is not directly possible. Docker is preventing you from doing this for security reasons. It would only work in ā€œprivilegedā€ mode.

Iā€™m not mounting the share at all. Instead I use smbclient - a command line tool which uses the SMB protocol to communicate with the share.

Works like a charm.
Thanks alot.
Now I can sleep much better, knowing I no longer have to manage my backups manually.

btw:
does it make sense to exclude the backup-folder to keep the backup small(er)?

exclude_folders:
  - backup

Works like a charme, iā€™m uploading on my OpenMediaVault nas. Thans a lot for this very appreciated plugin!

Hi @thomasmauerer thanks for your work !

due security reasons the ping on my NAS is forbidden, I try your addon but it doesnā€™t work because the first step (ping) failsā€¦but Iā€™ve access to my NAS in SMB (testing in Windows environnement).

how to ā€œpassā€ the first test ? test the SMB port ?

Just saying thanks, works perfect to my Synology!

Itā€™s indeed a showstopper if ping is not allowed. But testing the smb ports is not really a good alternative. If somebody is not using the default ports, itā€™s the exact same story.

Maybe you could just whitelist the IP address of your Home Assistant device.

Hi @thomasmauerer, Thank you for this great add-on! I stumbled upon it last week and installed it yesterday; works wonderful! Really a good addition to my system.

I have one question, when I look at the share on my Synology NAS, I see beside the Directory with the snapshots:

 /hass-bu/snapshots-222/<slug>.tar

an other directory with name:

/hass-bu/snapshots-222/#recycle/snapshots-222/samba-tmp123
and  <filename>_1 -- _8  

(there are 9 files at the moment.)
All are empty files (0) for every attempt I made with the addon.
Can you explain me what the function is of these files and secondly, can I remove the files without introducing problems?
Kind regards, and thank you for this add-on! Bert

@thomasmauerer very cool addon. Thanks very much!

@thomasmauerer
Very useful addon.
Thank you