Created new add-on to backup snapshots to Google Drive

hassio-addon
Tags: #<Tag:0x00007f2037e5ccd0>

#1

I created a new add-on to backup hass.io snapshots to Google Drive. You can install it using my add-on repository following these Home Assistant Add-on Instructions. You can see the readme here for information.

This is my first HA add-on, and my first community code contribution of any kind…so buyer beware. :slight_smile:

I couldn’t find the i386 build script. So, despite the fact that my add-on advertises support for the i386 architecture, it doesn’t really. :frowning: If anyone can offer some help there, I’d appreciate it. I appears I need proper authorization to pull that builder from Docker Hub???

I’ve tested this on my Raspberry Pi Hass.io setup.


[HA-Cloud] Full backup to Google Drive
#2

Hi @samccauley,
Thanks for sharing your add-on. I just gave it a try and it just works as specified, after following the instructions. :+1:

Do you have any future plans to include features like keeping a certain number of backups and deleting older backups?


#3

Thanks a lot. I use the Dropbox backup addon which works perfectly but since my log is so big (1gb +) it fills up my Dropbox space immediately so for me is unusable.
From first reading seems this addon enables to choose which files to backup (what I would need is just NOT backup a single file, the log file), so it’s great for my needs, thanks


#4

Tried to add your repository, but after clicking ADD, it’s not adding the repositopry in HASSIO


#5

Yes! That is exactly what I have planned. Maybe in a couple weeks.


#6

Hmmm… Do you see anything in your hass.io system log when this happens?


#7

Nothing in log, I put the below link, is it correct (https without spaces of course)?

h t t p s://github.com/samccauley/hassio-repository


#8

Yeah. That’s right. Here it is again copied and pasted from my hass.io add-on store on my own HA: https://github.com/samccauley/hassio-repository

Have you tried adding any other third party repositories before? Successfully?


#9

Yes I have more than 5. I run hassio on a NUC


#10

Hmmm… I have no idea what the cause might be. I did try something, though. I removed i386 from the list of supported architectures in the configuration for my add-on (I shouldn’t have had it in the list to begin with). That shouldn’t cause a problem with you adding the repository, though. But, it was the only thing I could think of to try. You may try again, but I’m honestly not hopeful that what I did would make a difference.


#11

No, still not working, below the LOG

18-11-05 11:03:13 INFO (SyncWorker_7) [hassio.docker.addon] Start Docker add-on homeassistant/amd64-addon-mosquitto with version 3
18-11-05 11:03:13 INFO (MainThread) [hassio.services.mqtt] Set core_mosquitto as service provider for mqtt
18-11-05 11:03:13 INFO (MainThread) [hassio.discovery] Send discovery to Home Assistant mqtt from core_mosquitto
18-11-05 11:03:13 INFO (MainThread) [hassio.homeassistant] Updated Home Assistant API token
18-11-05 11:03:13 INFO (MainThread) [hassio.discovery] Discovery 74313f3847c04af080xxx message send
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on https://github.com/danimtb/dasshio repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on https://github.com/stefangries/hassio-addons/ repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on https://github.com/stefangries/hassio-addons repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on https://github.com/neffs/hassio-addons repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on https://github.com/home-assistant/hassio-addons repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on https://github.com/marthoc/hassio-addons repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on https://github.com/hassio-addons/repository repository
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 INFO (MainThread) [hassio.addons] Load add-ons: 80 all - 0 new - 0 remove
18-11-05 11:06:56 INFO (MainThread) [hassio.addons] Load add-ons: 80 all - 0 new - 0 remove


#12

Klagio,

As a test/workaround, could you try setting my add-on up as a local add-on? This involves these steps:

  1. Create a subdirectory in your hassio addons directory named something like googlebackup. You may need to use something like the Samba add-on to get access to do this.
  2. Download my config.json file and place it into that directory.
  3. Go to your hass.io add-on store and click the refresh circle in the top-right corner.
  4. You should (hopefully) see my add-on appear there under “Local add-ons”.

Let me know how that goes. If it doesn’t show up, please look in your logs to see if there are any helpful messages from this test. Thank you.


#13

It works fine. Thanks a lot


#14

Well, the good news is that it worked. The bad news is that it’s still a mystery as to why it would not add directly from my repository, and this is not a very good long-term workaround because you won’t get updates with this setup.

I’ll keep giving this some thought. It seems more likely now that the problem is with my repository rather than with my add-on. That at least helps narrow down where I need to focus. Thank you for your patience.


#15

I get the following error when trying to perform the backup, any idea?

{“errorMessage”: “<HttpError 404 when requesting https://www.googleapis.com/drive/v3/files?q=name%3D’34347d59.tar’+and+‘hassio-backup’+in+parents+and+trashed+%3D+false&spaces=drive&fields=files(id%2C+name)&alt=json returned “File not found: .”>”}


#16

You are using the wrong string for the google drive folder - follow instructions in the documentation. I had the same issue. :blush:

Blockquote

You must instead provide Google Drive’s unique opaque ID of the folder. Google Drive doesn’t make it easy to get this value. But, here’s how you can get it:

  1. In your favorite web browser, navigate to the Google Drive folder to which you plan to upload your files (create a new folder in Google Drive if you wish). Be sure that you have the perferred folder open so that its contents (even if it’s empty) are displayed.
  2. From the address bar of your browser, copy the last portion of the URL. That value is Google Drive’s unique opaque ID for the folder. Paste that value in for the backupDirID value in the configuration.

Blockquote


#17

hi guys,

is it possible to set up an automation to create a snapshot daily or once a week, i so could you please share the config code?

many thanks


#18

Yes. It’s described in this thread.


#19

Version 1.1.0 is out now and it has this “purge” support added to it.


#20

I completely missed this on my search
Thank you