Hass.io Add-on: Upload hassio snapshots to Dropbox

How do you trigger this one?

Does any one know why I am getting this error?:

19-03-09 02:19:41 WARNING (SyncWorker_11) [hassio.snapshots.snapshot] Can't snapshot folder homeassistant: [Errno 2] No such file or directory: '/data/homeassistant/home-assistant_v2.db-shm'

Here is my automation:

alias: Backup Nightly
hide_entity: false
initial_state: 'on'
trigger:
  platform: time
  at: '02:00:00'
action:
  - service: hassio.snapshot_full
    data_template:
      name: Automated Backup {{ now().strftime('%Y-%m-%d') }}
      password: !secret snapshot_password

Seems like it is not backing up the HassIO config folder, but the V2 database file is in the config folder.

Update: Copied the automation back into my config .yaml file and last nights backup worked. The automation was exactly the same so cannot explain this one?

Thanks

So I just had my first SD Card failure :cry: and I thought I was ok because this addon was performing all my snapshot backups, but what I didn’t realize is that my dropbox account was full :sob: and I lost all my snapshots for the last month. Does anyone know if there is there anyway to do a keep_last on the dropbox side? Or do you have to manually remove old snapshots.

Atleast I didn’t lose everything, but I’m attempting to restore and man… it’s not as simple as I thought it would be. I HIGHLY recommend having a second drive handy any ready to go. Especially if your SD Card is approaching a year old.

Thank you for this addon.

I have one issue: I set keep_last: to 5.

It does the backup, moves the file to dropbox, deletes the snapshot entry from the Hassio UI, but looking at the /backup folder via WinSCP, files are not deleted from the /backup folder.

Any suggestions?

The problem reported in the above post resolved: it was a bad snapshot file; removed and all good.

I am seeing the following error when I try to install the add-on:

19-03-28 01:02:33 INFO (SyncWorker_7) [hassio.docker.interface] Pull image d0ugal/hassio-dropbox-upload-armv7 tag 1.1.2.
19-03-28 01:02:34 ERROR (SyncWorker_7) [hassio.docker.interface] Can't install d0ugal/hassio-dropbox-upload-armv7:1.1.2 -> 404 Client Error: Not Found ("pull access denied for d0ugal/hassio-dropbox-upload-armv7, repository does not exist or may require 'docker login'").

The add-on repository URL I am using is https://github.com/d0ugal/hassio-dropbox-upload. This is a fresh install of hassio with my config files copied over manually. My searches have not revealed any helpful insight into this yet.

Thanks for any information anyone may have.

Any thought of supporting OneDrive?

Any way to exclude folders within the share directory? I am running Hassio on Ubuntu hosted in Hyper-V and have a shared drive mounted in the share directory containing around 70GB of media for use with Plex. If I do not deselect the Share directory when manually creating a snapshot, I get an error stating there is not enough space to create the snapshot. This is all fine for manual snapshots, but it would be nice to have the ability to exclude the mounted folders I use for Plex and still backup everything else in the Share directory.

Answered my question here: Hassio 0.61 Snapshot Service

Created this automation but its not uploading to dropbox:

  • id: ‘1557695136824’
    alias: Snapshot
    trigger:
    • at: ‘2:00’
      platform: time
      condition: []
      action:
    • service: hassio.snapshot_full
      data_template:
      name: Automated Backup {{ now().strftime(’%d-%m-%Y’) }}
    • delay: ‘01:00:00’
    • service: hassio.addon_stdin
      data_template:
      addon: “7be23ff5_dropbox_sync”
      input: {“command”:“upload”}

If I separate the script and run the backup, then the upload, all works, it seems it doesn’t like the delay function.

Has anyone else got this working or do I need two separate automations?

Hi, I’m sorry if an obvious question, but how should I set the data parameters on an AppDaemon call?
I’ve tried this one:

self.call_service("hassio/addon_stdin", addon="7be23ff5_dropbox_sync", input = "{'command':'upload'}")

and got this error on the log:

"{'command':'upload'}"
jq: error (at <stdin>:1): Cannot index string with string "command"
[Info] Received message with command 
[Error] Command not found: 

Thanks.

[Edit]

Solved by @TD22057, the call should be like this:

 self.call_service("hassio/addon_stdin", addon="7be23ff5_dropbox_sync", input = {'command':'upload'})

simple and nice!

Upvoting a keep_last_Remote to manage also the amount of files saved on the Dropbox side. Thanks :slight_smile:

1 Like

@danielwelch it’s my 3rd post here and just noticed I haven’t mentioned how great is your add-on! thanks for publishing it!!

small request though - can you please add time stamps to the log?

@sapnho did you ever get this resolved? I’m getting same error.

I’m getting the following error. Any ideas why?

[Info] Files will be uploaded to: /Hassio_Backups/
[Info] Saving OAUTH_ACCESS_TOKEN to /etc/uploader.conf
[Info] Listening for messages via stdin service call...
{"command": "upload"}
[Info] Received message with command upload
[Info] Uploading all .tar files in /backup (skipping those already in Dropbox)
 > Uploading "/backup/062fd142.tar" to "/Hassio_Backups/062fd142.tar"... FAILED
An error occurred requesting /upload
 > Uploading "/backup/0c2a51b5.tar" to "/Hassio_Backups/0c2a51b5.tar"... FAILED
An error occurred requesting /upload
 > Uploading "/backup/5fb21403.tar" to "/Hassio_Backups/5fb21403.tar"... FAILED
An error occurred requesting /upload

Hi @El_Duderino, I am afraid, I never did.

I actually figured it out if you (or anyone else) is interested. Turns out to be user error…shocker! :slight_smile:

I didn’t hit the “generate key” and was using the wrong dropbox key.

Now it’s working as intended.

Hi Daniel,
would be fantastic to simply add a command to the addon which can check for space left on Dropbox and create a home assistant sensor. This would allow to make an automation which sends a telegram or ios notification to the user when space on dropbox is finishing…
I notice in the code that the only command allowed is “upload”, but in the if one can ad an elseif for the space command, run

./dropbox_uploader.sh space

which will return

Dropbox Uploader v1.0

Getting space usage info…

Quota: 2048 Mb
Used: 464 Mb
Free: 1583 Mb

(as in my case). From this one can get the Free: token and return it to home Assistant as sensor or something similar. …

one then can trigger the reading of the sensor by calling the hassio.addon_stdin service with the following service data:

{“addon”:“7be23ff5_dropbox_sync”,“input”:{“command”:“space”}}

A better way would be if this can be done after all uploads to update the remaining space…

or if this is done before uploading, to check if next backup will fail or not (one normally knows the average size of the backup (mine is 140 Mb).

cheers
Edoardo

Hi,
due to limited space I would like to only upload the most 3 recent backups. Is that possible to implement?

1 Like