Samba Backup: Create and store backups on a Samba share

Yes, you can do that.

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

This addon uses the backup functionality provided by the supervisor and unfortunately, the supervisor only allows to exclude those five folders.

I donā€™t know the Nest cameras, but can you maybe configure a different storage location (outside the config folder) somehow?

This addon uses the backup functionality provided by the supervisor and unfortunately, the supervisor only allows to exclude those five folders. I donā€™t know the Nest cameras, but can you maybe configure a different storage location (outside the config folder) somehow?

Thanks for the response. From what I have found, the only option is to configure Nests to stop saving the clips, but I would like to keep them, just not inflate my backups with them. I will keep looking, I expect that it will become a problem for others as time goes on.

Thanks again!

Tom

I donā€™t have a Nest, but is there no way to specify the storage location?

The supervisor shares by default homeassistant , ssl , share , addons/local and media folders. These are the only folders that Samba can ā€œseeā€ to backup.

So, before the Samba backup starts, have a cron job running that deletes the contents of config/nest/event_media an hour before the backup starts.

Thanks for the idea. I donā€™t want to delete the files, I just donā€™t want to back them up. But I could set up a routine which moves the files to a folder on another computer and manage them from there. Not ideal, but a solution.

Tom

Tom- Is a subscription to the Nest cloud required to use the Nest integration?

No. I donā€™t use the Nest subscription.

Any idea why sensor.samba_backup randomly disappears, and reappears after restarting the add-on?

Hello Thomas,

Iā€™m using since a few months Samba BackUp suceesfully, now since 3 days I have realized that is not working anymore, please see log bellow. From my PC I can acces normally the share, no issue there.
I did not do any changes to my network or to the NAS.

Thanks,

[22-05-08 23:05:32] INFO: Trigger time: 00:00
[22-05-08 23:05:32] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[22-05-08 23:05:32] INFO: ---------------------------------------------------
[22-05-08 23:05:36] WARNING: do_connect: Connection to xxxxxxxx failed (Error NT_STATUS_NOT_FOUND)
[22-05-08 23:05:36] FATAL: Cannot access share. Unknown reason.
[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.

Thanks ! I just tested it. The add-on worked great !

I normally backup to my NAS, which uses a ton of power, and is thus not online 24/7. I use WOL to wake it up. The NAS goes to sleep after 15 minutes based on lack of network activity. On other operating systems, I have a script that sends a WOL command to the NAS before starting the backup. Most backup programs have a way of invoking a pre-task script. It would be very helpful if there was some way to invoke WOL before the backup.

However, another problem would remain here :

The backup took 20 minutes to complete. I see that the file was created 18 minutes after the start of the backup task. And the file completed writing at 20 minutes. Perhaps that sort of speed (lack there of) is expected on a Rpi3B+ with microSD. The problem is that even if WOL was invoked at the start of the task, the NAS would go to sleep at 15 minutes, before Samba backup actually starts writing the file to the share. I could increase the NAS sleep period from 15 minutes to 20 or longer to fix this, but that ends up costing money and is also bad for the planet. Perhaps the WOL script could be invoked just before the TAR archive needs to be written to the Samba share, as opposed to the start of the backup task. This would obviously require skipping prechecks.

Thanks in advance.

Bernard,

I noticed the same problem this morning. Since May 4th the backup to the samba share fail with the same error you showed.

Marco, I had before the 4th May in the configuration the name of the NAS. The other day I have tried different settings, and the one working was when I have replaced name with the IP address, and I have managed to get a connection and have again regular backups.

Try it and let me know if it worked out for you as well.

1 Like

Hi,
As I get error on uploading backup on my usb stick I tried to upload it manually. My backup file is 1.8 GB and I got error

Uploaded backup is too large

This is probbably the reason I got this error on uploading backup when I run this samba backup

INFO: Copying backup 508fad92 (Samba_Backup_2022_05_13_08_38.tar) to share
[22-05-13 08:52:35] WARNING: cli_push returned NT_STATUS_IO_TIMEOUT
NT_STATUS_CONNECTION_DISCONNECTED closing remote file \USB_BACKUP\ha-backup\Samba_Backup_2022_05_13_08_38.tar
[22-05-13 08:52:35] WARNING: Could not copy backup 508fad92 to share. Trying again ...
[22-05-13 08:53:00] WARNING: protocol negotiation failed: NT_STATUS_IO_TIMEOUT

Can you @thomasmauerer please check this out and fix a problem?

Bernard, changing the configuration to use an IP address instead of the name of my NAS did the trick. Thanks.

1 Like

Iā€™ve just added this to my HA setup on a Raspberry Pi. Is there a way I can test it instead of waiting for the next time itā€™s supposed to do a backup?

Just want to say thank you for this perfect tool. Works like a charm!

(HA supervised and OMV 6 NAS)

Yup; RTFM : hassio-addons/DOCS.md at d0e2c06560b29f9e9add501033efca8e5aafef6c Ā· thomasmauerer/hassio-addons Ā· GitHub

@thomasmauerer you saved my HA instance a lot of times :stuck_out_tongue:

Okay.

So to do that I need to know how to write a script, where to save it, and how to trigger it.

Yeah, still trying to get all my add-ons working. I was hoping there might be something I could do without having to do an hour or more of reading before I could do it.

As of now, with a new system, I just tried to change my configuration I just edited in the Configuration page for this add-on and it wonā€™t save for some reason.

I just kept changing the time in the config page to 1 minute in the future.

Now I see it works when I specify the IP address in host, but when I use the host name instead, it does not connect. Iā€™ve tried it as ā€œbackupsystemā€ and ā€œ//backupsystemā€ and neither works. (Did not include quotation marks.) What do I need when I specify a host by name that is not needed with the IP address? (My local DNS adds the domain automatically - havenā€™t had to include the domain on anything in a long time.)

Nope, you have to go to developper tools ā†’ services ā†’ look for the service hassio.addon_stdin and fill up the settings according the manual.

You just have to specify the hostname. without any ā€œ//ā€ or anything. A DNS never adds a domain automatically. The DNS clients may have a search list of domains and append them automatically to the requests without any domain name. So you should probably add the domain name manually.

Thank you! Iā€™m not trying to just be lazy, but Iā€™m dealing with trying to restore an old configuration (my backup files on a RAID didnā€™t do well in the storm that knocked out our internet and the old HA setup) and Iā€™m still learning and thereā€™s a lot to deal with.

This is probably a networking issue and itā€™s not critical since I have it working, but I think I should bring this up, just in case itā€™s a symptom of something bigger.

I set up this configuration:


And I got this result:

So I added my full subdomain and domain for my LAN in the configuration:


And with that one change, it worked:

I realize itā€™s quite possible this is not a HA issue at all and could be an issue with my LAN. I didnā€™t even think of testing it with the full domain on there until I was writing my previous reply and that occurred to me as a potential issue. I thought, ā€œNoā€¦ā€ but 10 minutes later I thought, ā€œI really should test that.ā€

So itā€™s working, itā€™s just odd it needs the domain, since thatā€™s the only thing Iā€™ve dealt with in my LAN that has needed it.