Samba Backup: Create and store backups on a Samba share

@thomasmauerer has already ideas to solve the issue, as I just saw: Replace CLI with direct API calls · Issue #79 · thomasmauerer/hassio-addons · GitHub
Thanks for this addon.

Sounds great!

I hope for a solution soon.

While we’re at it with ideas for further development; Generational backups would be a nice addition as well.
This is from the Google Cloud add-on - but I’d really like to have as much as possible in my own private cloud.

Thank you for a great add-on @thomasmauerer - it’s super to have local backup!

Hi. I’m getting this error:

Host/Share: 192.168.33.251/HomeAssistant
[23-02-28 09:58:15] INFO: Target directory: backups
[23-02-28 09:58:15] INFO: Keep local/remote: all/all
[23-02-28 09:58:15] INFO: Trigger time: 00:00
[23-02-28 09:58:15] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[23-02-28 09:58:15] INFO: ---------------------------------------------------
[23-02-28 09:58:18] WARNING: cd ackups\: NT_STATUS_OBJECT_NAME_NOT_FOUND
[23-02-28 09:58:18] FATAL: Target directory does not exist. Please check your config.

Config matches what I connect to via MacOS. What is the weird character in the dir name about do you think?

Why are you using a backslash? Normally it should be a slash.

OK. I am brand new to Haas. Downloaded the official Samba Share and there was a tab for configuration. I downloaded your Add-on by adding your repository. But there is no tab to config. How is everyone doing all these configurations? If it matters, I’m on the HA OS, running on ODroid N2+.

So Basically you go to your home assistant (your.ip.of.homeassistant:8123/hassio/store) and then you should see the AddOn
grafik
Then go to “Configuration”


There you can add the SMB-Share/Fileserver Credentials you want to copy to.

Just out of curiousity because you mentioned the Samba-Addon, which is irrelevant for this Addon:
what do you want to accomplish (basically what is your intended plan)?

If you want to Use this Addon to Copy the Backup to your Homeassistant: this NOT be the intended way. (It might be technically possible, but in my opinion a technical overkill and totally overengineered)

This Addon is mainly to copy your backup to other PCs/Servers via the SMB-protocol.

If you want to make “normal” backups and have them available via SMB (with your Samba-Addon), just use the following automation/blueprint:

tl;dr:
Do you want to accomplish this:
grafik

Or do you really want to accomplish this:

When I install the addon, under the configuration tab it say: This add-on does not expose configuration for you to mess with…

When I hit start it says: Missing required option ‘host’ in Samba Backup (15d21743_samba_backup)

And if I go edit it says: This add-on does not expose configuration for you to mess with…

I am going to be migrating to MariaDB + InfluxDB in the coming weeks. Will this backup program take clean (e.g. NOT crash consistent) backups of these databases? Meaning, flush buffers, finish writes, etc. before a snapshot/backup is taken to ensure it will restore correctly?

I followed the instructions for getting the Samba sensor to start on a Home Assistant restart via Blueprint. It worked maybe 1-2x, then it fails after that. HA 2023.3.6. Any ideas?

I am struggling to get this add-on to start and not stop itself.

Here is my configuration details I am trying.

host: 192.168.1.100
share: HASS
target_dir: /media/backup/HASS
username: *****
password: *****
keep_local: all
keep_remote: "28"
trigger_time: "03:30"
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []
backup_name: Local {type} Backup {year}-{month}-{day}
workgroup: WORKGROUP

Here are the details of my samba share from webmin. My samba share is just a USB stick plugged into the mac mini I am using to run Debian Bullseye/Home Assistant.

Unfortunately, the add-on keeps getting stopped with the following error.

Any help would be greatly appreciated. Thanks in advance.

If I look at my config try the following change, remove the first “/” and the target dir “HASS” as share is already HASS

target_dir: media/backup/

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.
image

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:
image

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"
trigger_days:
  - Wed
  - Sat
exclude_addons:
  - 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.