Samba Backup: Create and store backups on a Samba share

Thank you. I tried that, but keep getting the same warning and fatal messages as above.

How does the Samba Backup determine when to create a full and when a partial backup?

Since i enabled it I see two full backups in a row and then three partial ones.

Trying to bite through the logic e.g. when is the next full backup.
Also would it be possible to play with that logic, like one full, one partial, all full etc?

Here’s the config:

mediaackup? Sure?

I am following the steps listed in the documentation. Every time I go to save I get:

Failed to save add-on configuration, does not match regular expression ^(manual|([0-1][0-9]|2[0-3]):[0-5][0-9])$. Got {‘host’: ‘TRUENAS’, ‘share’: ‘XXXX’, ‘target_dir’: ‘Home Assistan Backups’, ‘username’: ‘XXXX’, ‘password’: ‘XXXXXXX4’, ‘keep_local’: ‘5’, ‘keep_remote’: ‘5’, ‘trigger_time’: ‘3:00’, ‘trigger_days’: [‘Wed’, ‘Sat’], ‘exclude_addons’: [‘a0d7b954-vscode’], ‘exclude_folders’: []

My code:

host: xxxxxxxxxxNAS
share: xxxxxxxxNAS
target_dir: Home Assistan Backups
username: xxxxxxxx
password: xxxxxxxxx
keep_local: "5"
keep_remote: "5"
trigger_time: "3:00"
  - Wed
  - Sat
  - a0d7b954-vscode
exclude_folders: []

Can someone help me?

That is strange indeed, is this the addon while the seeting are correct?

From the DOS command line, can you log on to the host and write anything to the directory on the shared file?

My configuration is pretty simple. I backup every day shortly after midnight to a computer running as an NAS. (I also run Samba Share add-on so that I can see my config folder from my PC.)

The format of trigger_time is incorrect. It must be “03:00” (-> HH:MM). And the exclusion of addons will not work either, since addon slugs use underscores instead of hyphens. So it must be “a0d7b954_vscode”.

1 Like

I think there is a misunderstanding about the target_dir option This option is needed if you have sub folders inside one share. It’s not the full path to your share. In your case it should most likely just be empty:

target_dir: ''

Thank you sir. That worked. Much appreciated.

What I don’t understand about HA and this addon is you make it seem writing to a Samba share is not that hard, and can be accomplished by someone with good skills.

Many people have requested for HA to read and write to a Samba share for cameras and to read for music but have been told it isn’t a projected core functionality. Yet, you’ve done it as a simple to use addon.

I just do not get it.

So I have been using this successfully for a few months but in the last 2 months I have an issue where I have set the keep local to 2 but it doesnt delete the backups locally and after a few days the drive fills up and HA obviously stops working. Config looks like this. Any one else get this?

Having checked the logs it looks like the file write to Samba share has failed.

[23-04-24 15:12:02] INFO: Copying backup ad426673 (Samba_Backup_2023_04_24_14_05.tar) to share
[23-04-24 15:13:11] WARNING: cli_push returned NT_STATUS_NETWORK_BUSY
NT_STATUS_CONNECTION_DISCONNECTED closing remote file \HA-Backup\Samba_Backup_2023_04_24_14_05.tar
[23-04-24 15:13:11] WARNING: Could not copy backup ad426673 to share. Trying again ...
[23-04-24 15:14:03] WARNING: cli_push returned NT_STATUS_NETWORK_BUSY
NT_STATUS_CONNECTION_DISCONNECTED closing remote file \HA-Backup\Samba_Backup_2023_04_24_14_05.tar
[23-04-24 15:14:20] INFO: Backup finished

Hello everyone,
Samba Backup worked very well until April 16, since I no longer have any backup and I have this error message in my logs, I specify that if I launch the backup manually it runs correctly.

[23-04-26 03:00:53] INFO: Creating backup "HABackup 2023.4.6 2023-04-26 03:00"
[23-04-26 03:00:53] ERROR: Error occurred! Backup could not be created! Please try again
[23-04-26 03:00:53] DEBUG: Posting sensor data to API at /core/api/states/sensor.samba_backup
[23-04-26 03:00:53] DEBUG: API Status: 200
[23-04-26 03:00:53] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"FAILED","attributes":{"friendly_name":"Samba Backup","backups_local":"5","backups_remote":"10","total_backups_succeeded":"143","total_backups_failed":"1","last_backup":"2023-04-25 03:12"},"last_changed":"2023-04-26T01:00:53.517537+00:00","last_updated":"2023-04-26T01:00:53.517537+00:00","context":{"id":"01GYXH7PWDYEH77X74ZF4KF0E7","parent_id":null,"user_id":"a295a7fe709e4892ae2d4aa14063b2aa"}}
share: SauvegardeHA
target_dir: /
username: XXXXXXX
password: XXXXXX
keep_local: "5"
keep_remote: "10"
trigger_time: "03:00"
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
  - /media/motioneye/
workgroup: MAISON
log_level: debug
backup_name: HABackup {version} {date}

Edit: I just checked on my NAS, the backup has been created but I still have this error message.

Works for me with no errors.
Backups scheduled at 3 am:

Dear Thomas,
thx for this great add-on.

It is possible to run this tool outside from HA in his own Docker Container.



Thank you for a great add-on! I had no problems installing it and connecting it to the Synology DSM. The two cards make it easy to do a manual trigger and see the status of the backups. I’m working on the button card, but that’s a bit more than I can get my head around right now.

I was also getting the generic error:

Error occurred! Backup could not be created! Please try again

And all I did to fix it, was this:

- target_dir: home-assistant-backup
+ target_dir: /home-assistant-backup/

Apparently those slashes are important.

Someone else seeing the “Last backup” attribute not updating for a (long) while? @thomasmauerer

This buggers me a lot meanwhile.

Works fine here…


Would you share your versions of

  1. HA Core
  2. HA Supervisor (!)
  3. HA OS if applicable
  4. SAMBA Backup addon

Hoping for a version specific/dependent issue.

Home Assistant 2023.5.3
Supervisor 2023.04.1
Frontend-version: 20230503.3 - latest
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 5.10.0-22-amd64
Architecture: x86-64

Samba Backup
Current version: 5.2.0