Hassio 0.61 Snapshot Service

Thanks, this is really useful!

What about rotation of backup files?
I don’t want to fill up my SD-card with backups :slight_smile:

Also: A way to copy the backup-files to some external storage (e.g. with scp) would be very good.

5 Likes

Not a scp solution, but the easiest solution for me was to create a scheduled task on my DC to call a simple batch script after the snapshot was made to copy the contents of the \\HASSIO\backups directory to another PC that I use essentially as a NAS device and then delete the contents of the backup directory.
Doing this from Windows means Samba has to be installed and configured.
The batch script looks like this:

@ECHO off
SET Source=\\HASSIO\backup
SET Target=\\SERVERNAME\share\Hass.IO_Backups
SET Date=_%date:~-4,4%%date:~-7,2%%date:~-10,2%
IF NOT EXIST "%Target%" MD "%Target%"
FOR %%i IN ("%Source%\*.*") DO ^
COPY "%%i" "%Target%\%%~Ni%Date%%%~Xi"
IF EXIST "%Target%\%%~Ni%Date%%%~Xi" DO (
DEL "%Source%\*.*" /Q
)

Keep in mind my snapshots aren’t appended with the date like NotoriousBDG’s are. You’ll probably want to drop that from either the automation or batch script.

2 Likes

Is it possible to do a daily snapshot to a USB-dongle (on a RPi3), and to get a notification only if the backup proses fails?

I’m working on an add-on that allows you to upload your /backup directory to your Dropbox.

Currently, you have to manually start the add-on to trigger the upload to your Dropbox, but I’d eventually like to make this a more automated process (as I discuss at the bottom of the README). I think this combined with the snapshots automation here would be really nice.

5 Likes

+1
Great Job! Please complete the automatic upload :wink:

I’ve updated the add-on to v1.0.0. The uploading is triggered via a service call, so it can be automated just as any other home assistant service (like making snapshots) :wink:

See here for more. @ezar

1 Like

Can any one explain me if this is an option in the full ha version in a venv?

No. This is a hassio feature.

Any intentions of adding Google Drive support? :slight_smile:

Coincidentally I just answered a question about google drive in the main project thread. I think it’d make more sense to do it in a separate add-on, but since you’re interested I’ll look into making one.

3 Likes

How about an option to make backups using scp as well?

I went ahead and made a shell_command instead

shell_command:
    copy_backups: scp /backup/* wdmycloudmirror:~/hassio-backups
    delete_backups: rm /backup/*

If I ssh into hassio and run scp /backup/* wdmycloudmirror:~ then it works just fine using ssh keys, but if I call the service trough hassio then I get an error code 1. How come?

Is /backup/ not accessible from shell_command? One has to create a docker? I have no experience with that though - dang. Probably time well spent anyways.

1 Like

When you use the shell_command component, you’re calling that command from Home Assistant, which runs on Hass.io but is not the same and is designed to have restricted access. As you say, implementing your shell command as an add-on would be the way to go if you want to trigger it or automate it from the front end.

I cant find this in the docs anywhere, what is the difference between partial and full snapshot?

Try clicking on it and you will find out what the difference is maybe?

I’ve now created an addon that creates a snapshot, copies it to a remote server location using SCP and then removes the local snapshot again. Then I have a simple automation script that starts the addon every day on timed schedule.

At the moment I’ve just made it local but let me know if anybody wants be to distribute on Github.

2 Likes

Yeah, dude, if its not too much trouble. That’s a rad add-on. I’m sure many will us it.

No problem @hfyoung3 ! I’ve been on quite the journey. Kudos to @danielwelch for this excellent blog and @frenck for all the great dev tools!

The Remote Backup add-on are now released: automate your snapshots to a remote server by exploiting hassio cli and scp.

2 Likes

Great, thanks for this addon!
Can you add the possibility to support password protected snapshots?

That shouldn’t be too difficult. But I might not have any time to implement it before the weekend though.