Samba Backup: Create and store backups on a Samba share

No issues here either.

I have replied in more detail to the GitHub issue you opened.

Exactly that’s the main pain point here. Not a single response for months.

I fear to say… everyone running in an issue sooner or later been left with a somehow not well-working backup solution should have a look at the new native network mount support and see if HA already can provide the same set of features out of the box like

  • create backup locally
  • copy backup to network share
  • set file name of local/remote backups
  • version control: keep X local and Y remote backups

It’s just damn annoying being left with a malfunctioning piece of software - an important one cause backups can save asses.

Last hope to finally get dev response and hopefully fix the issue in this basically really great addon is getting down to zero meanwhile unfortunately. My summary based on the last 3 months:

:warning: SAMBA BACKUP = UNMAINTAINED :warning:

1 Like

I have just started using this Add-On but I don’t think anything is broken.

I was having the exact problem detailed above, logs give warnings about not being able to rename the file, the file is created anyway (with a random name rather than the name specified in the config) says it failed in HA.
Try setting your backup location in
Settings → System → Backups → Burger/3dot menu → change default backup location
Set it to “Use data disk for backup”
Set your “Keep Internal backups” in the add-on config to 0 (if you want)

That fixed it for me

1 Like

It looks like the issue with your backup is that the SambaAddon cannot rename the copied file.
But the copy itself went fine…
Check access rights on the share?

It is so unfortunate that it is not supported. I have been using this one from around the original release. What I find to be the real bummer? I also run Unraid and when a module author goes missing, more often than not another dev picks it up and maintains or improves the package. It seems that there are less people with knowledge in the HA community (smaller community) and therefore a few have more work to do to advance the product and maintain status quo. I wish I had the skill set to maintain a plugin and help with this kind of stuff, but I really do not have coding skills and at 58 am just not interested in trying to learn more than I know at this point which is basic perl and shell scripting.

This is not a slam against devs in the HA community, unfortunately just a fact of life.

I made a lot of backups to test. Now my local storage is full.
Where are the backups of the Samba addon stored?

ls /backup is empty

Exactly, where you did specified with the installation.

Go to the addon config, you can see the path there.

Local backups are on the same place, as HA would save them.

The backups always failed.
The .tar file could not be found.

The NAS where to save is empty.

Homeassistant’s hard drive is now so full that I can no longer make backups.

Then there is a chance, you have a lot of temporary files somewhere, I don’t know, where they would be…

/tmp is empty


rm -R /mnt/data/supervisor/mounts/XXX

Worth giving it a try, but:
there are no options next to “Use data disk for backup” and therefore can’t be saved

No I don’t want - and I absolutely don’t see how that setting could fix something. It’s more likely due to the restart of the addon something magically fixed itself in your case. Lucky you.

Used SAMBA share user has full access rights. The files on the target are correctly renamed. E. g. Samba_Backup_Partial_Backup_2022_12_9_2023_07_18_02_00.

No progress here :frowning_face:
I set addon log level to debug for now, hoping the get any more details.

The main question is WHY THE HELL the Samba backup sensor status switches to FAILED only because one WARNING (bogus file rename log entry) is logged but the whole process is completely fine.

Anyone seeing anything suspicious in here? I don’t think so, but who knows.

share: Backups
target_dir: HomeAssistantServer
username: user
password: pass
keep_local: "3"
keep_remote: "45"
trigger_time: "02:00"
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
  - 47701997_rhasspy
  - a0d7b954_influxdb
exclude_folders: []
backup_name: "{type} Backup {version} {date}"
log_level: debug

@NilsK89 check this post where the default storage can be checked. Usually it’s the default backup folder/share.

Thanks a lot Neonteepee,

You found the solution to the problem.

WARNING: f439c76c.tar does not exist
WARNING: Could not copy backup f439c76c to share. Trying again …
WARNING: f439c76c.tar does not exist

The solution is effectively to change:

Settings → System → Backups → Burger/3dot menu → change default backup location and Set it to “Use data disk for backup”

If you don’t want to keep local backup in HA, then set your “Keep Internal backups” in the Samba Backup add-on config to 0.

The thing is, the default backup location for System Backup in my case was set to my Samba shared folder. So it’s normal for the error to occur since backups are done on the local disk and the default System Backup location was set to my Samba shared folder. Backup tried to find the backup file in the Samba shared folder but the file exists locally. Changing System Backup’s default location from my Samba shared folder to “Use data disk for backup” solved the problem.

1 Like

Attribute "last_backup" does not update / backup status FAILED even they are actually SUCCESSFUL · Issue #146 · thomasmauerer/hassio-addons · GitHub is fixed.

Hi. Several bug reports have been raised reporting that the Samba Backup addon is broken when you use the new native HA NAS function.

I looked a bit. Thomas has not posted anything on this forum since March and not contributed anything on Github since April.

Something must have happened to him. Death. Jail. Marriage. Marriage and baby?

Looking at the addon - it seems a bit redundant. It is an Addon because it added samba client to the OS. That is not needed anymore. The rest is implemented as Bash scripts.

I think we are better off making an equivalent without the Addon using just built-in Home Assistant features.

We can easily schedule backups using automations and calling the service.

But we need implement cleaning up and deleting old backups so it does not pile up. Anyone already implented something like this?

You can send the status via telegram with the following code:
message: Samba backup {{ states('sensor.samba_backup')|lower }}.

Is there a way to send the last_backup > date & time?

Found it
message: Samba backup {{ state_attr('sensor.samba_backup', 'last_backup') }}

I recently moved away from this add-in to a core custom component - Auto Backup, available via HACS.

With HA now able to backup to Samba Shares natively, this custom component fills in the rest of the blanks. I’ve been using it for a couple of weeks now without issue.

Samba Backup was a brilliant addition to my HA instance for a long time and I’m extremely grateful to the author for the work they did in the past.

Dear all !

just want to report that if the host is not reachable, the local backup is done but old backup is not locally deleted as defined and the memory space requirement is growing until no space are available.

Indeed, I changed night power on of my NAS to standby for few hours and I forgot the impact on HA backup until HA told me “No enough space”…

Could you change this behavior ?

My log file to illustrate that :
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/
 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 10.5  (amd64 / qemux86-64)
 Home Assistant Core: 2023.8.3
 Home Assistant Supervisor: 2023.08.1
 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/ exited 0
cont-init: info: running /etc/cont-init.d/
cont-init: info: /etc/cont-init.d/ 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
[23-08-22 00:07:26] INFO: ---------------------------------------------------
[23-08-22 00:07:26] INFO: Host/Share:
[23-08-22 00:07:26] INFO: Target directory: HomeAssistant
[23-08-22 00:07:26] INFO: Keep local/remote: 9/100
[23-08-22 00:07:26] INFO: Trigger time: 04:00
[23-08-22 00:07:26] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[23-08-22 00:07:26] INFO: ---------------------------------------------------
[23-08-22 00:07:27] INFO: Samba Backup started successfully
[23-08-22 04:00:28] INFO: Backup running ...
[23-08-22 04:00:28] INFO: Creating backup "Backup_HomeAssistant_2023-08-22 04:00"
[23-08-22 04:01:31] INFO: Copying backup ed17accf (Samba_Backup_Backup_HomeAssistant_2023_08_22_04_00.tar) to share
[23-08-22 04:01:34] WARNING: do_connect: Connection to failed (Error NT_STATUS_HOST_UNREACHABLE)
[23-08-22 04:01:34] WARNING: Could not copy backup ed17accf to share. Trying again ...
[23-08-22 04:01:42] WARNING: do_connect: Connection to failed (Error NT_STATUS_HOST_UNREACHABLE)
[23-08-22 04:01:56] INFO: Backup finished
[23-08-23 04:00:00] INFO: Backup running ...
[23-08-23 04:00:00] INFO: Creating backup "Backup_HomeAssistant_2023-08-23 04:00"
[23-08-23 04:01:00] INFO: Copying backup fbc8f368 (Samba_Backup_Backup_HomeAssistant_2023_08_23_04_00.tar) to share
[23-08-23 04:01:03] WARNING: do_connect: Connection to failed (Error NT_STATUS_HOST_UNREACHABLE)
[23-08-23 04:01:03] WARNING: Could not copy backup fbc8f368 to share. Trying again ...
[23-08-23 04:01:12] WARNING: do_connect: Connection to failed (Error NT_STATUS_HOST_UNREACHABLE)
[23-08-23 04:01:25] INFO: Backup finished
[23-08-24 04:00:29] INFO: Backup running ...
[23-08-24 04:00:29] INFO: Creating backup "Backup_HomeAssistant_2023-08-24 04:00"
[23-08-24 04:01:27] INFO: Copying backup ed7d84c2 (Samba_Backup_Backup_HomeAssistant_2023_08_24_04_00.tar) to share
[23-08-24 04:01:30] WARNING: do_connect: Connection to failed (Error NT_STATUS_HOST_UNREACHABLE)
[23-08-24 04:01:30] WARNING: Could not copy backup ed7d84c2 to share. Trying again ...
[23-08-24 04:01:38] WARNING: do_connect: Connection to failed (Error NT_STATUS_HOST_UNREACHABLE)
[23-08-24 04:01:52] INFO: Backup finished
[23-08-25 04:00:56] INFO: Backup running ...
[23-08-25 04:00:56] INFO: Creating backup "Backup_HomeAssistant_2023-08-25 04:00"
[23-08-25 04:02:01] INFO: Copying backup 389bb386 (Samba_Backup_Backup_HomeAssistant_2023_08_25_04_00.tar) to share
[23-08-25 04:02:03] INFO: Deleting e36cbe6e (Full Snapshot_HomeAssistant 2023-08-15 04:00) local
[23-08-25 04:02:03] INFO: Deleting e6ec2bad (Full Snapshot_HomeAssistant 2023-08-14 04:00) local
[23-08-25 04:02:03] INFO: Deleting faa96240 (Full Snapshot_HomeAssistant 2023-08-13 04:00) local
[23-08-25 04:02:04] INFO: Deleting d00a768a (Full Snapshot_HomeAssistant 2023-08-12 04:00) local
[23-08-25 04:02:04] INFO: Deleting e83e6a31 (Full Snapshot_HomeAssistant 2023-08-11 04:00) local
[23-08-25 04:02:04] INFO: Deleting 60a453de (Full Snapshot_HomeAssistant 2023-08-10 04:00) local
[23-08-25 04:02:04] INFO: Deleting da8addd2 (Full Snapshot_HomeAssistant 2023-08-09 04:00) local
[23-08-25 04:02:04] INFO: Deleting ffd4548e (Full Snapshot_HomeAssistant 2023-08-08 04:00) local
[23-08-25 04:02:04] INFO: Deleting d7a42c79 (Full Snapshot_HomeAssistant 2023-08-07 04:00) local
[23-08-25 04:02:04] INFO: Deleting 9bebfb6a (Full_Manuel_2023-08-07_00h20) local
[23-08-25 04:02:15] INFO: Backup finished
[23-08-26 04:00:19] INFO: Backup running ...
[23-08-26 04:00:19] INFO: Creating backup "Backup_HomeAssistant_2023-08-26 04:00"
[23-08-26 04:01:16] INFO: Copying backup 6a554346 (Samba_Backup_Backup_HomeAssistant_2023_08_26_04_00.tar) to share
[23-08-26 04:01:17] INFO: Deleting 0089fb28 (Full Snapshot_HomeAssistant 2023-08-16 04:00) local
[23-08-26 04:01:28] INFO: Backup finished

Thank you very much! I was trying to figure this out for a couple of days!