Best strategy for copying HA backups to a different location

Hi,

I’m a new home assistant user. I just set it up on a Home Assistant Blue box (which had been sitting for about 9 months in the box waiting to get set up). I don’t trust all my backups living on the same storage device as HA itself. I have a separate Linux-based NAS that I would prefer to backup to. My network is all Linux, so I don’t have Samba and don’t want to set it up just for the sake of HA. I also don’t use google drive. What’s the best way to get the backups out of HA and onto my NAS?

I’m very comfortable with admin’ing Linux boxes. I’ve installed the Terminal and SSH add-on. Should I just set up a cron job on my NAS to SSH into the HA box and copy the backups out of the /backups folder? Can I set up a cron job on HA to push backups to my NAS? Is there an API I can use with curl or some other mechanism to request the creation of a backup and then remotely access it? It seems like HA likes to keep the operating system guts out of view, so poking into /backups myself seems like it’s not ideal.

Thanks for any suggestions!

-Mike

I use this. Works well.

I know you mentioned NAS… But figured i’d drop this since its a set-it-and-forget-it.

1 Like

OTher than that, you could just call a shell_command from home assistant to execute something like rclone to push the backup dir to your nas. You can generate a backup with

Then just copy them up.

You can also use the “ha backups” command at the linux level to run it from a shell script. then push it.

backup to google drive might also work for you. I know it’ll be out of your system, but it’s a one time install, setup and then forget until required. No commands / coding required.

As I said in the original post, no interest in using google drive or samba.

I got excited when I saw that there is an API that allows for creation and download of backups: Endpoints | Home Assistant Developer Docs. I spent a while trying to make this work with curl, however after much frustration I found that this API is not exposed to the LAN: Supervisor External API Access.

I wonder if I can proxy these requests through SSH?

You could use this rsync addon.

1 Like

Or setup Duplicati…very easy, many options and free