Samba Backup: Create and store backups on a Samba share

Hi, can you please figure out how to do a backup without the camera footage in a specific directory? They are bulky and I don’t need them in backup. This code doesn’t work:
Snímek obrazovky 2024-01-18 093123
Thanks a lot!

I have multiple HA NUC’s but only 1 Synology NAS. Backup is working fine if it’s a local host.

Can I use an external host for the backup? I have been trying to use an external IP (DNS) address but it doesn’t work. Also Access via Synology doesn’t work. It probably has to do with port issues…

If anyone can advise please?

You have to mount an NFS share. In the HA GUI you can do it via System / Storage and had your network share.
In my case, for MB free, I have 2 network shares :

  • One for the classic share (change the location in system/backup
  • One for Samba Backup for longlife backup and keeping n versions of backup

This is working fine as long a I fill in the local IP address. But as soon as I type in the external IP or DNS name it cannot connect. I want to connect with HA, which is outside the NAS network, to my NAS NFS (or SMB) to backup.

ah
You can’t share NFS on differents network when one is external.
It need open ports on firewall and it is an error to do this…
If you want do this, you have to mount an IPSEC VPN between two sites to have a local network beetwen !

I have IPSEC VPN running on my network where my NAS is located… if this is the only way forward, what plugin do you recommend for an IPSEC VPN connection?

I’m not fan of it, but if this is the only way to go… I possible can automate it to open a VPN connection temporarily, do the backup and close it down again…

thanks in advance.

For security reasons you can’t share directly on internet SMB or SAMBA. I’m not sure you can because a lot of ports and nat to do.
You have a lot of hardware (router) or software to do this.
Maybe your router can.
Each location have to mount the VPN against.
You have to find tuto for this

On a quick search I didn’t find any addon to establish an IPSec connection from HA. Same for a VPN client addon, except for this one that seems abandoned.

I guess the only option left is to stand up an IPSec gateway on the HA LAN so that HA can access the NAS on the other end.

Do you mean for each HA LAN to make a permanent VPN tunnel to the LAN of my NAS? The downside of it, is that a make a large virtual network and probably HA is going to see devices that are not literally on my network. Also from a security standpoint, I don’t like as renters may have access to the LAN with the Synology (and more important data).

At the other hand, I have Draytek Vigor routers everywhere so I could easily setup VPN tunnels…

Actually the app DS File supports to upload files from outside the NAS network. Such a kind of solution I wish it had been build in into HA…

If anyone has a good alternative for an Add-on to make a secure IPSEC VPN connection, please let me know.

On the IPSec gateway you should be able to specify which networks/IPs have access. And then through the firewall further restrict it to only the specific protocol and port HA needs.

This right here fixed my issue as well! TY!

the addon access the share directory correctly how ever I got the following error
" error occurred! backup could not be created! please try again."
the share is working correctly but the backup failed
how it could be fix ? any ideas ?

I set up the addon at the weekend but am having trouble updating the configuration. It seems to be “stuck” with my initial configuration whatever I do.

Here’s what I did:

On 2024-02-24 I did the initial setup, setting the trigger time to the near future, 16:30. This worked - it did a backup at 16:30 and wrote it to the share.

I then investigated the facility for triggering a manual backup. I did one at 16:58, and that worked too.

Next, I changed the trigger time to 01:00 and left it.

It didn’t do a backup at 01:00 on 2024-02-25 or today 2024-02-26, but it did do one at 16:30 on 2024-02-25, i.e. my original trigger time.

Curiously, the sensor says it has done 2 backups, the last being the manual one.

This morning I’ve tried changing the trigger time several times but can’t get it to trigger another backup.

The info tab of the addons page shows the status of the addon as “stopped” (red dot) - is this expected? Clicking “Start” seem to have no effect (nothing new in the log). The sensor says it is “Idle”.

Am I missing something here? Should I be able to make configuration changes on the fly? Do I need to poke something to get the change to take effect?

This problem seems to have fixed itself. I accepted an automatic update of the HA system, and after it restarted, this addon worked as I expected it to. It now shows as “running” and asks to be restarted after a configuration change. I presume there was some version incompatibility here.

I have the same problem. I have set this:

host: xxxxxx
share: xxx
target_dir: Backups
username: xxxx
password: xxxxx
keep_local: "5"
keep_remote: "10"
trigger_time: "21:45"
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []
backup_name: Automatic Backup {date}

and there is more than 10 backups on share from samba backup. is there some problem?
thank you!

Hi there,
I have a tiny bug since I moved everything to RPI5:
After a reboot or Home Assistant Restart, sensor.samba_backup is not available anymore and I have to restart the addon to solve this.

This is a great add-on. The thing that I think could be added to make it even much better, would be implementation of some manner of a ‘Tower of Hanoi’ backup schedule, as described on Wikipedia (Backup rotation scheme - Wikipedia. It’s akin to the grandfather-father-son backup schemes we used to use back in the days of tape-backups, but it can be adapted to modern backups via net shares too. With a Hanoi schedule, you can keep backups effectively covering much larger time periods, while still only keeping a relatively small numbers of backups on hand. I won’t re-describe the whole thing here, the wikipedia article says it all.

Thanks again for the great add-on,
best wishes, lcm

1 Like

Still relevant with modern backup media, and included in almost any IT certification exam.

Good idea! That’s what I’ve done now. I had previously selected a PC, but it is not always switched on. Thanks for your tips on the config. Thanks also to the developer, of course, it works perfectly!

So today I wanted to restore a backup of MariaDB from the backups made by Samba Backup.
Nice surprice: Samba Backup doesn’t backup the MariaDB addon.
Would anyone know why it isn’t included?
I only have these add-ons listed as exluded: a889bffc_rtsp2webrtc; a0d7b954_esphome; d5f40609_doods