Backup Questions

This thing is starting to really be something and doing some work… i’ve been backing it up frequently… But… I’ve heard stories that HASS and the pi tend to lunch the micro sd card periodically… I’m using a large Sandisk Extreme Pro A2 card… I’d like to put something cheaper in there and back it up to the network… I’m sure as hell not wanting to set this thing up again… lol… I’m aware of an add on called Samba that lets me look at files?? The new external storage option sounds great, but i’m clueless how to set it up… So where does the backup file go, and how do i save a copy of it that i can store safely? if my sd card bursts into flames, does my backup go with it? does samba have a scheduled backup routine? i’m still just smart enough to be dangerous at this point, so somebody give me a direction to go with this? Thanks in advance!!!

What do you have to backup to?

Your most important item is - get a copy of the backup off the card in case the card dies - you have the copy.

Backups live in \\[host]\backup. They’re .tar files therefore any extraction tool that can open a tarball should be able to see inside.

(I’m assuming your install type is HAOS so Addons are available)

I use a tool to get the backup and copy it for me - Google Drive Backup Addon:
Add-on: Home Assistant Google Drive Backup - Installation / Home Assistant OS - Home Assistant Community (home-assistant.io)

You may also use something like the SAMBA backup Add-on. Basically the same idea - just moving it to a SAMBA (read: SMB, local file server) share. (If you have a NAS, or something similar)
Samba Backup: Create and store backups on a Samba share - Share your Projects! - Home Assistant Community (home-assistant.io)

There are two useful add-ons:

Samba share allows you to access HA from elsewhere across the network.

Samba backup will schedule backups and copy them elsewhere if required. Mine are copied to the NAS, which in turn sends a copy to Dropbox.

I also find it helpful to copy all the config files to the NAS periodically using Samba share (not too often). It’s been very helpful in resurrecting old bits of yaml and answering the “How on earth did I do that?” question.

1 Like

I have an automation to backup the system:

- id: '1616952644144'
  alias: Backup System Tu Fr Su
  description: Create a backup on Tuesday, Friday and Sunday
  trigger:
  - platform: time
    at: input_datetime.backup_system
  condition:
  - condition: time
    after: input_datetime.backup_system
    weekday:
    - tue
    - fri
    - sun
  action:
  - service: hassio.backup_full
    data:
      password: !secret owner_password
  mode: single

and one that backs up my yaml at the UI set time. If I mess up an automation I have a backup immediately available. If I stop using an automation, I also save it offline for future examples.

- id: 'Backup yaml'
  alias: Backup yaml
  description: Run tar command to backup data at input time
  trigger:
  - platform: time
    at: input_datetime.tar_yaml
  condition: []
  action:
  - service: shell_command.copyfiles
  mode: single

I hope this is helpful.

1 Like

i have some storage on my network, i have several usb extrernal drives, i could plug into the pi itself… a thumb drive… whatever…