Samba Backup: Create and store backups on a Samba share

Hi,
thank you for creating this add-on!
I just tried installing it but get the following error when I try to configure it:

Failed to save add-on configuration, Missing required option 'host' in Samba Backup (15d21743_samba_backup). Got {'host': None, 'share': None, 'target_dir': '', 'username': '', 'password': '', 'keep_local': 'all', 'keep_remote': 'all', 'trigger_time': '00:00', 'trigger_days': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'exclude_addons': [], 'exclude_folders': []}

I’ve tried these two configs and variations of them but always get the same error:

{
  "host": "192.168.178.xxx",
  "share": "xxx",
  "target_dir": "backups/ha-backups",
  "username": "xxx",
  "password": "xxx?",
  "keep_local": "5",
  "keep_remote": "20",
  "trigger_time": "04:00",
  "trigger_days": ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],
  "exclude_addons": ["core_ssh", "core_duckdns"],
  "exclude_folders": ["ssl"],
  "backup_name": "{type} Backup {date}"
}
host: 192.168.178.xxx
share: xxx
target_dir: 'backups/ha-backups'
username: 'xxx'
password: 'xxx?'
keep_local: 5
keep_remote: 20
trigger_time: '03:00'
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []

What am I doing wrong?

Thank you!

Make sure path “192.168.178.xxx/xxx/backups/ha-backups” is valid.

Thanks. Unfortunately it is. Username and password are also functioning. I can connect to the SMB share and folder via a command line. So that all seems to be working fine.

Figured it out. I had missed a HA update. After installing that saving the samba config worked.

Hi - sorry if I’m being thick here as I’m not too technical - but how do I configure this to backup to a share on a MAC? Looks like it searches for a directory under the Windows naming convention. I have a share set up already :slight_smile:

Do you mean a Mac or MAC (Media Access Code, the hardware address of an ethernet or WLAN card)?
What type of share did you create on your Mac? If it is a samba share (SMB) it should behave the same as a Unix, Linux or Windows server. There is no other naming convention. It is SMB, nothing else. Your Mac is a Unix machine.

@thomasmauerer could it be there has been a change causing the addon to fail?

I didnt change anything from a configuration perspective but it stopped and as such HA stopped eventually with no disk space left …

in the logs I see “parse error: Invalid numeric literal at line 1, column 5” but as I said, the config itself has not changed

Hi, I have a question:

On the one hand, I use Auto-Backup to create various hourly, daily and weekly backups.
In addition, Samba-Backup starts and creates a backup once a day.

Now I have set the parameter “keep_local” to “14” and, as stated in the documentation, all other backups are also deleted. I don’t really want that.

Is it possible that Samba-Backup only deletes its own backups?

Or can the deletion for all variants be outsourced to a separate automation?

Thank you very much.

It might have been obvious to others, but it was a lightbulb moment for me that I could use Samba Backup to point to a OneDrive share on my laptop, which is then synced automatically. All I had to do was create a share of the OneDrive folder in Windows.

I also use Samba Share to expose the HA folders. I then use AOMEI Backupper on my Windows laptop to sync the HA folders to the same folder on which I store the Samba Backup files. Of course each of the HA folders are stored separately.

Samba Backup configuration:

Samba Share configuration:

Folders exposed by Samba Share:

Folders on my OneDrive:
image

AOMEI Syncs: Note that the Backup folder is not synced by AOMEI because Samba Backup does this

Hi
Is any chance to setup in this addon samba backup more than one trigger time ? I want create two backup by day: 12:00 and 00:00

You can disable the automatic backup for the addon and create an automation for your backups.

Option: trigger_time

The time at which a backup will be triggered. The input must be given in format ‘HH:MM’, e.g. ‘04:00’ which means 4 am. You can also use your own Home Assistant automations to trigger a backup - see Manual Triggers for more information. If you want to disable the time-based schedule completely, set the option to manual.

is this addon working for others at the moment? see some reports on the repo and mine has been disabled as its not working at the moment, doesnt copy to file share …

The addon works perfectly here without any hiccups (core-2021.11.1, supervisor-2021.10.8, Docker 20.10.10).

thanks - had to tweak a bit - seems to be an issue with potential size, my backup ran for 3+ hrs and had 8+GB, excluded backup of my influxdb (resulting in less than 4.5GB) now and it is working again.

Great addon!

Just 2 small things not working:

exclude_folders:
  - /config/photo/
backup_name: '[{"input_text.backupinfo"}-{date}] [V.{version}]'

1 - The map ‘photo’ is still always included…
2 - It would be great if we could add some information with an input_text box

Post #14 does mention this (I think), but the name is always started with “Samba_Backup” anyway, would be nice to have some space to add own info.

Samba Backup was working fine until now. The first letter of the Target directory is being chopped off preventing the startup. What can I do? 4

Not exactly sure where to submit an enhancement request so I’ll put it here.

It would be nice to backup the zigbee/zwave coordinator configuration incase that fails and replacement hardware is needed.

Thoughts?

Hi all,
did anyone had issues with retrieving backups? i had to restore backup and apparently samba backup was incomplete comparing with my config, for example i had ui-lovelace.yaml on root folder, but when i tried to retrieve the backup there is none, it recovered my addons but with no configuration (for example esphome has none of my devices). so basically i lost so many configs i find this not as reliable to make backup as google drive addon.
my config is set to full backup so i don’t understand what happened. i always keep 5 backups on my NAS but all are the same. im running home assistant on supervised on Debian 11, same i was running before.
What could be the reason why its not creating the snapshot correctly?

host: 192.168.X.XX
share: ha_backups
target_dir: \
username: joel
password: caio2015
keep_local: 5
keep_remote: 5
trigger_time: '01:00'
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []
backup_name: '{type} Backup {version} {date}'

I want to get the time relative to the last backup, but seems imposible. looks like the sensor give the timestamp formatted and not raw.

type: custom:stack-in-card
mode: vertical
cards:
  - type: entities
    title: Home Assistant - Server
    entities:
      - type: divider
      - type: custom:multiple-entity-row
        entities:
          - entity: sensor.hacs
            name: HACS
            unit: ' '
            styles:
              width: 50px
              text-align: center
          - entity: binary_sensor.updater
            name: false
            icon: mdi:update
            state_color: true
            styles:
              width: 50px
              text-align: center
        style: |



          :host .entities-row div.entity:nth-child(1)  {
          {% if states('sensor.hacs')|float > 0 %}
            color: var(--state-icon-active-color) !important;
          {% else %}
            color: var(--state-icon-color) !important;
          {% endif %}
          }
          :host .entities-row div.entity:nth-child(2)  {
          {% if states('binary_sensor.updater') == 'on' %}
            color: var(--state-icon-active-color) !important;
          {% else %}
            color: var(--state-icon-color) !important;
          {% endif %}
          }
        entity: sensor.samba_backup
        secondary_info:
          attribute: last_backup
          format: relative
          name: false
        name: Backup
        icon: mdi:update
        show_state: false

Hi Tom,

great Add-on - just one question:

I get a lot of entries in the user.log (about 5 every 2 seconds) looking like this:

Dec 15 20:56:54 rpi4-20210718 4e43575018b4[573]: [INFO] 172.30.32.1:37764 - 59786 "A IN server1.local.hass.io. udp 36 false 512" SERVFAIL qr,rd 36 0.000970772s

This happens when the server1 is not available and this is normal, because the server is started only for backups.

Any idea how this could be solved?

Thanks
Markus