Scheduled Backups

Hello!

I wonder how people solve the task of backing HASS up?

It’s no wonder that RPi’s are not THE most reliable computers, and even less so - microSD cards. So it’s good idea to regularly backup the whole image of the system. In that case if something goes wrong, it’s easy to just format the card, and write that working image, and plug it back into same or new RPi.

Right now I’m using Win32 DIsk imager, but this way I have to power off RPi and perform backup manually. I wonder if it can be automate and ran from under working RPi?

I know that it’s easy to create scheduled backups of, say, config files with WebMin, or even a simple Python script, just archive the folder and write it to some external location.

But in Windows there are multiple tools that allow you to create an actual drive image of a working and running system. I wonder if there is something like that for Raspbian\Hassbian?

So far the only similar thing I found is LinuxRespin. Did anyone use it? Can it actually do what I’m looking for? Are there any alternatives to that?

Ideally I’d also like a similar solution for both Raspbian and Ubuntu.

Thanks! :slight_smile:

I do nightly filesystem backups of my HA and home directories via a cron job in Webmin and then image backups before every point release update, so basically what you are doing now.

I’d never heard of respin before, but I had heard (just heard, not used) remastersys from which it was forked. But it does look like a possible solution.

I’m going to look into it, thanks.

If your running windows, you could actually do a backup to your network drive with the built in backup system it has on its own. You can create a boot disk (cd i think) minimal that will allow you to restore the full pc. Have not used it in ages but assume its still there. That way you always have a full backup.

Or if you have a NAS, you could always pxe boot from iscsi drive instead of the disk in the machine. But might be over the top a bit :slight_smile:

1 Like

I think I mentioned that I’m interested in solutions for Raspbian\Hassbian and Ubuntu :slight_smile:

I’m running Windows on my work and media\gaming PCs, but backing them up is not the problem, Windows has a lot of tools for that, including built-in tools, and other tools free or payed. I’m currently using EaseUs ToDo Backup to make regular backups of my Windows machines.

But HASS is running on Raspberry Pi, and I have a NAS machine in the closet. They run Hassbian and Ubuntu 16.04 LTS respectively. These two machines need backups :slight_smile:

For now I’m just doing it manually, by taking out their system drives (microSD or SSD) and plugging them into my Windows machine, and making a backup with either win32 diskimage tool or EaseUs one. But I want to automate the process.

Ah woops, windows is my work/gaming pc too :slight_smile: I know that if you have a RPI3 you can boot from your NAS as a network boot disk. But this is not something one does easily. The thing i do is that i write down what i install besides my .homeassistant folder. That way a fresh install is to run some command, and restore the files from usb. Do keep in mind if you z-wave and your stick dies, you need to re-add all your devices again, there is nog backup for that (automatic) only the 5-1in aen stick has a feature to backup (windows only)

I use WinSCP when I edit/modify. After I’m done with some changes in a certain day, I just make a new local directory called 2017-05-20 for example and copy the HASS folder over minus the deps, tts, and ozw_config symlink.

Then every few weeks I do an SD card image and a Z wave stick backup.