Samba Backup: Create and store backups on a Samba share

We’re not there yet. From the get go the SMB backup straight away starts a backup as Snapshot.
im writing to ZFS and the file limit there is 16 exbibytes, so we’re good. I have a proxmox backup on the same share but that is VM backup. I wanted home assistant backup.

Hello Guys,

i just installed Samba Backup and set config to do at 0300AM.
System: Home Assistant OS on a PROXMOX Server…

On next day my Proxmox Instance is Shut Down??! How is this Possible?

Since updating to latest v5.1.2 (which fixed things, great update :+1:t3:) I see a quite huge increase of memory usage when running a custom SAMBA backup:

  • Memory usage climbs up at the end of the backup run when the copy process finishes.
  • The addon seems to hold that memory for one to two days (I have a daily backup).

Not sure if it’s something to worry about. It just changed to how the addon behaved before v5.1.2. Worth to report as an issue?

Thanks for this really useful add-on.
I have installed and configured it using the UI
Set up an automation to manually trigger a backup now (for testing)
All good - have a ‘Samba_Backup_2022_10_31_14_13.tar’ file on my NAS

Want to be sure about restore! (I’ve been caught out before)

I can see the local backup in Settings Backups - wonderful - and am offered the option to restore it.

What happens if I have to do a fresh install of HAOS onto my SD card. How do I access the backup on the NAS?

Better to know in advance - thanks

Will try answering my own question.
Boot up fresh HAOS install
Install the Samba share add on
From PC or whatever copy the backup file from NAS to backup folder on HA
Restore backup

Yes or no? Thanks

There’s an easier way: do a fresh install, boot it up. You can then restore directly from the login screen on your favourite browser.

See here for more info.

Thanks for the reply. I had seen the linked doc but just not clear to me that it can access files on a NAS.

It all goes by a bit quick but looks like it is accessing a local file - which I get it can’t be if it’s a fresh install.

What can browsed - NAS, windows PC, MAC?

If I had an SD card going spare I’d test it and see.

Thanks again

If you read the linked post, the author talks about storing the backups off of the HA host, meaning you will restore from elsewhere. Your browser will upload the file to your HA instance, so whatever files your browser has access to are accessible.

Thanks, yes had read the linked post but as I said not clear to me - that’s why I was asking.

Now it is clear - the browser uploads the file to HA and then HA can restore it.

EDIT: I’m a dummy. My first backup has been created. Thanks for this add-on, works great!

I tried this add-on on an Azure Storage account using the Files capability, but get’s this error.
Anyone else tried this on Azure Files and/or anyone having any idea how to solve this

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.2.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.3  (armv7 / raspberrypi3)
 Home Assistant Core: 2022.10.5
 Home Assistant Supervisor: 2022.10.2
-----------------------------------------------------------
 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-11-16 00:57:08] INFO: ---------------------------------------------------
[22-11-16 00:57:08] INFO: Host/Share: xxxxhomeassistant.file.core.windows.net/backups
[22-11-16 00:57:08] INFO: Target directory: xxxxxxxx
[22-11-16 00:57:08] INFO: Keep local/remote: 5/all
[22-11-16 00:57:08] INFO: Trigger time: 00:45
[22-11-16 00:57:09] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[22-11-16 00:57:09] INFO: ---------------------------------------------------
[22-11-16 00:57:15] WARNING: do_connect: Connection to xxxxhomeassistant.file.core.windows.net failed (Error NT_STATUS_IO_TIMEOUT)
[22-11-16 00:57:15] FATAL: Cannot access share. Unknown reason.

Hello,

since three days I get an error message during backup that does not help me. Nothing has changed on my NAS. Where can I find more error messages? Thanks!

[22-11-16 10:20:45] INFO: ---------------------------------------------------
[22-11-16 10:20:45] INFO: Host/Share: 192.168.178.47/sicherungen
[22-11-16 10:20:45] INFO: Target directory: hass
[22-11-16 10:20:45] INFO: Keep local/remote: 14/30
[22-11-16 10:20:45] INFO: Trigger time: 01:00
[22-11-16 10:20:45] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[22-11-16 10:20:45] INFO: ---------------------------------------------------
[22-11-16 10:20:46] INFO: Samba Backup started successfully
[22-11-16 10:20:57] INFO: Backup running ...
[22-11-16 10:20:57] INFO: Creating backup "Samba Backup 2022-11-16 10:20"
[22-11-16 10:20:57] ERROR: Error occurred! Backup could not be created! Please try again

No more space on the NAS/backup folder?

Thanks for the answer. There is still enough space on the NAS.

Enable debug in samba backup.

Thank you, here is the output. I can’t see any errors.

[22-11-17 13:06:55] INFO: Samba Backup started successfully
[22-11-17 13:06:55] DEBUG: Starting stdin listener ...
[22-11-17 13:06:55] DEBUG: Starting main loop ...
[22-11-17 13:07:02] DEBUG: Input received: "trigger"
[22-11-17 13:07:02] INFO: Backup running ...
[22-11-17 13:07:02] DEBUG: Backups local/remote: 14/14
[22-11-17 13:07:02] DEBUG: Total backups succeeded/failed: 14/11
[22-11-17 13:07:02] DEBUG: Last backup: 2022-11-14 01:03
[22-11-17 13:07:02] DEBUG: Posting sensor data to API at /core/api/states/sensor.samba_backup
[22-11-17 13:07:02] DEBUG: API Status: 200
[22-11-17 13:07:02] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"RUNNING","attributes":{"friendly_name":"Samba Backup","backups_local":"14","backups_remote":"14","total_backups_succeeded":"14","total_backups_failed":"11","last_backup":"2022-11-14 01:03"},"last_changed":"2022-11-17T12:07:02.991288+00:00","last_updated":"2022-11-17T12:07:02.991288+00:00","context":{"id":"01GJ2QRFJFNN8Y1B9Q1WW5DQHG","parent_id":null,"user_id":"f895f41162c34ade905150ba9ecc2ba7"}}
[22-11-17 13:07:03] INFO: Creating backup "Samba Backup 2022-11-17 13:07"
[22-11-17 13:07:03] ERROR: Error occurred! Backup could not be created! Please try again
[22-11-17 13:07:03] DEBUG: Posting sensor data to API at /core/api/states/sensor.samba_backup
[22-11-17 13:07:03] DEBUG: API Status: 200
[22-11-17 13:07:03] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"FAILED","attributes":{"friendly_name":"Samba Backup","backups_local":"14","backups_remote":"14","total_backups_succeeded":"14","total_backups_failed":"12","last_backup":"2022-11-14 01:03"},"last_changed":"2022-11-17T12:07:03.330521+00:00","last_updated":"2022-11-17T12:07:03.330521+00:00","context":{"id":"01GJ2QRFX2CG5WP2CN6JG5RQ5Q","parent_id":null,"user_id":"f895f41162c34ade905150ba9ecc2ba7"}}
[22-11-17 13:07:13] DEBUG: Posting sensor data to API at /core/api/states/sensor.samba_backup
[22-11-17 13:07:13] DEBUG: API Status: 200
[22-11-17 13:07:13] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"IDLE","attributes":{"friendly_name":"Samba Backup","backups_local":"14","backups_remote":"14","total_backups_succeeded":"14","total_backups_failed":"12","last_backup":"2022-11-14 01:03"},"last_changed":"2022-11-17T12:07:13.401819+00:00","last_updated":"2022-11-17T12:07:13.401819+00:00","context":{"id":"01GJ2QRSQSQDDAF1JTV7CHK691","parent_id":null,"user_id":"f895f41162c34ade905150ba9ecc2ba7"}}
[22-11-17 13:07:13] INFO: Backup finished

What I noticed is that a normal backup doesn’t work anymore either. When I initiate this via the interface, the following message comes up:

Could not create backup
Creating a backup is not possible right now because the system is in startup state.

This will probably be related somehow?

Wow, this is a very long thread…

First of al Thomas, thanks for this great addon.

I just installed it a few days ago. I set the local max to 3. Unfortunately it deleted not only the backups it took but also the ones I took by hand before updating addons. Is this expexted behaviour? If so, the delete local is unusable for me.

The second bug I see is, that It seems that the configuration file is only applied once before the first backup. Every change I made afterwars is ignored. Is that right?
Thanks in advance for any insight in this.
Cheers

Greetings all. While my Samba backups all seem to be created fine, restoring is another story. When I have an old config to boot from how can I upload the TAR file. HA always claims the file format format is incorrect for this.

image

Hi Thomas,
You may (probably) have seen a number of threads asking for SMB shares to be able to mounted to HAOS for use with media players, Logitech Media Server, Frigate and other NVRs, and a a few other threads. I am trying to set up this add-on now so hoping it will work despite my clumsy fingers.

I have a question, please; your add-on is able to write to a Samba share, so how hard would it be to mount a Samba share for use by other add-ons?

Frank

@thomasmauerer
I installed the add-on, configured and started it with all options selected. It stops, seemingly for no reason, and is not restarted by Watchdog.

Is the add-on still viable?