Samba Backup: Create and store backups on a Samba share

See https://github.com/thomasmauerer/hassio-addons/issues/77 for this feature request.

1 Like

I realize that it has been a long time, but I had a similar problem caused by the deprecated emulated Hue - Alexa interface grabbing port 80.

Maybe a bit off topic, but what should I backup? I choose everything now, but the backups are growing some Mb per day. I have space, so that is not the issue.

Well you can probably skip the database as that is usually corrupted during backup.

Keep a copy of your addon configurations stored in a text file off system then you can skip a lot of addons too. You just need to reinstall them and copy the config over after a backup restore.

Im trying to exclude the ā€œwwwā€ folder and cant get it to do this. How can I accomplish this?

The manual says: The folders to exclude in the backup. This will trigger a partial backup if specified. Possible values are homeassistant , ssl , share , addons/local and media .

so, if these are the possible folders, www canā€™t be excluded.

  1. What delete command is used for the remote backup storage cleanup?
    I found a lot of ā€œshould be deletedā€ backups in my remote SAMBA storage .recyclebin folder - just wondering if I need to take care of them by my own or if thereā€™s an option to set the deletion command used for the remote storage.

  2. How to stop a currently running backup process?
    Can I safely stop the SAMBA backup addon and remove the unfinished backup file - or will the process run until it finished, independently of the addon status?

ad 1)
The standard rm command of smbclient. If youā€™re using a recycle bin, you have to delete the backups yourself from your recycle bin folder. The addon cannot do this automatically in this case.

ad 2)
You can stop the addon, but the backup will continue running until it is finished. The addon just tells the supervisor to create the backup. Thatā€™s exactly the same if you create a backup manually on the supervisor page.

1 Like

installing samba backup causes an ā€œUnknown error, see supervisor logsā€

Logger: homeassistant.components.hassio.handler
Source: components/hassio/handler.py:237
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 03:20:55 (4 occurrences)
Last logged: 09:55:12

Timeout on /supervisor/options request

and

Logger: homeassistant.components.hassio
Source: components/hassio/websocket_api.py:120
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 09:49:50 (3 occurrences)
Last logged: 09:55:12

Failed to to call /supervisor/options -

what do I do wrong?

Its this step

1. Navigate in your Home Assistant frontend to **Supervisor** -> **Add-on Store** 
and add this URL as an additional repository: `https://github.com/thomasmauerer/hassio-addons`

thanks

ps: I did setup my HA freshly yesterday from the official HA .vdi container.

edit: after several trys the repo got addedā€¦

i have this code in scipts

alias: backup
sequence:
  - service: hassio.addon_stdin
    data:
      addon: 15d21743_samba_backup
      input: trigger
mode: single

but i dont get a backup when triggered, and no entry in the logs

edit: 10 hours later, i just browsed by the backup location, and the backup from noon today was there. funny it took so long to show up for a 112mb backup. the smb share is on a 10gbs link to the HA server, its basically the same machine since HA runs in a VM on the NAS. so problem solved, lets see if the automation works :slight_smile:

Apologies for a super simple question here, but how do I install this?
I tried following the instructions on the Gitbhub page, namely adding https://github.com/thomasmauerer/hassio-addons as a repository, but once that is done, nothing else happens, no extra addons appear in the list, and if I search for samba backup, no results are found.
What am I missing?

Thanks

Did you tried to ā€œRestartā€ ?

I tried ā€œRestart Home Assistantā€ in the settings section. Maybe Iā€™ll try ā€œRestart Coreā€ or ā€œRestart Supervisorā€ in the Supervisor section. No idea what the difference isā€¦

Oh yeah - that worked! Thanks!

1 Like

Supervisor is ā€œFrontendā€, Core is ā€œHAĀ“s Coreā€, Host is ā€œOSā€ where HA-is running ā€¦ in short terms, then you might have VMware, which is an App on Windows OS(Host)

PS: Im not sure i would call HA an APP, as itā€™s much more than that( in my eyes) :slight_smile:
PS: sometimes you can just ā€œreloadā€ configuration.yaml( if changes made there, or in configā€™s present(loaded) there, ā€¦ but when itā€™s an ā€œAdd-Onā€ they mostly need ā€œdeeperā€ into Core(at-least first time)

Honestly, i still havenā€™t figured out, when or what, so i use same ā€œprocedure as you just mentionedā€, Restart after checking config, as it clears logfile ā€¦ im Dā€¦ Stubborn and Curious ā€¦ and love to see a Clean start-up logfile :grinning_face_with_smiling_eyes:

1 Like

Thank you very much for creating this add-on. It worked perfectly! And it saved me lots of time and effort trying create my own solution.

Well, Iā€™ve been trying to make it work but no such luckā€¦
Maybe someone can give me some ideas.

The config:

host: 192.168.2.45
share: HABackups
target_dir: /snapshots
username: ********
password: ********
keep_local: 2
keep_remote: 10
trigger_time: 'manual'
trigger_days:
  - Mon
  - Fri
exclude_addons:
  - a0d7b954-influxdb
exclude_folders: []
backup_name: '{type} SnapshotNAS {version} {date}'
log_level: debug

But then my log is lacking:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Or after some restarts:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22-03-24 21:51:50] DEBUG: 
[22-03-24 21:51:51] DEBUG: putting file samba-tmp123 as \samba-tmp123 (0.0 kb/s) (average 0.0 kb/s)
[22-03-24 21:51:51] INFO: Samba Backup started successfully
[22-03-24 21:51:51] DEBUG: Starting stdin listener ...

I can see that the user has connected with the NAS, on Synologyā€™s Log Center.
But when I trigger it, it works but ignores the ā€œexclude_addonsā€, so it goes beyond 3h.

Untitled-2

I donā€™t use this feature but it looks like the dash ā€œ-ā€ should be an underscore ā€œ_ā€ according to the example in the documentation.

a0d7b954_influxdb

Ughā€¦ as usual, the problem seems to be behind the keyboard. :expressionless:

Thanks, stephack! Iā€™ll check it now.

edit: It worked! :+1:

Hallo,

how can I configure the addon to create a full backup on Monday, and only a partial (only backup some addons) in Friday?

Thank you