Automatic backup in hass.io

Is there any way to automatically do backups of hass.io config or/and the entire SD-card?

Like this backup to dropbox

I know that hass.io have this snapshots but what I understand those can’t be automatically triggered (say every night) or stored on another unit then the SD-card.

3 Likes

I really would like that to have 2. backup is everything

I would really like to see a option to do a full SD card backup baked into hass.io as well. Backup onto another SD card would be fine but remote backup would be awesome!

3 Likes

I want to bump this thread. I just started working with Home Assistant in the form of Hass.io, I got everything working and learning quickly. But before I want to continue with using Hass.io as my main automation system, I would really like to have an automatic/scheduled backup option. At the minimum to a USB-stick, but preferably to a private cloud-system and/or Synology (in my case).

I have tried the backup-system for USB described in the Docs, but you apparently need root for that…

I’m also interested in this feature. Migrated to hass.io recently after corruption of my sd card. Would be graet to have a backup on a new system.

Any news about this? Anyone knows how to do?

I would love to be able to schedule a snapshot and save it to a samba share or email it to my gmail account or even save it to drive.

I have made use of the snapshot feature very often in the learning phase and to rebuild a corrupted system once, oh and to go from a pi b to a pi 2 now.

Syncthing.

Is that something you won’t or something you already have with hass.io?

I think it’s already available in hass.io. I run just a standard home assistant docker container and use a syncthing docker container to keep multiple copies, in multiple locations, and it allows me to keep versions, as well as edit all my configs on my desktop and have it sync across to my docker host almost instantly.

I have it installed but stopped now. What goes in the data section? Clues on how to use it would be great!

Couple of steps are required.

  1. you have a bind mount on your Home Assistant docker container to a volume that stores your home assistant config directory.

  2. you will use the same bind mount on syncthing for /data, which will translate to your home assistant config directory

Even though I am not using HASS.IO, I am using a similar configuration within my own Docker environment.

On my host, I have a directory that houses my docker bind volumes, so I have persistent data for my containers.

When I build my container, I use this command:

docker run -d --name="home-assistant" --privileged --restart unless-stopped -v /dev/ttyACM0:/dev/ttyACM0 -v /srv/docker/hass-config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant:latest

My syncthing container is built using this:

docker run -d --name="hass-sync" --restart unless-stopped -v /srv/docker/syncthing:/config -v /srv/docker/hass-config:/sync -p 21027:21027 -p 22000:22000 -p 8384:8384 -v /etc/localtime:/etc/localtime:ro -e PGID=0 -e PUID=0 linuxserver/syncthing

So the -v are the volume bind mounts that I use. I am connected to Syncthing from my desktop to sync that same directory to my desktop, and all changes I make to the config are nearly instantly synced over to my docker host which translates right into the config on my docker container running home assistant. Syncthing has versioning on deletes/changes so if I delete/change something incorrectly I have a chance to get it back. I have found this method to be the best for me. I can edit my configs locally using Visual Studio Code, and have it almost instantaneously update the docker configs.

This may be above my head… I really do not fully understand docker. With hassio the containers are already built… so I assume the first command is taken care of by the boot process? The second command is something that I would need to build on the machine after it is up and running?

Please pardon my ignorance…

Thanks

I am looking through the add-ons available for HASSio, but am not seeing syncthing in there. I could have sworn when I was testing hassio a few months ago that I saw that option in there.

This lack of flexibility in the system is why I ultimately moved on from hassio to my own system running docker. when you said you had it installed and wanted to know what goes in the data, I assumed you were talking about syncthing? You have me confused now. The commands I provided are for a pure docker install (NOT HASSIO), which if you understand how HASSIO is configured, is easy to translate the parameters.

hass.io seems to be more of a pain than a blessing right now.

The syncthing hassio addon is available at Repository: Bestlibre Addons repository.

1 Like

Thanks for that. I was pretty sure I had set up syncthing in my hassio testing.