Backup to dropbox

Dropbox has changed their api, but I can’t find a way to get it working again. It looks like everyone is using google drive, but I will not give google my (unencrypted) backup as all my passwords are in it too. So I would love to use dropbox. Any suggestions?

Are you using this:

As this is still currently working for me.

Yes, that’s the one I am using.
Maybe I have to reconfigure it. I got some mail from dropbox that their tokens were changing and their TLS, but I don’t know what to change:

We’ve recently updated our access tokens, and will be updating TLS at the end of the year—you’ll want to review to ensure your app handles these correctly.

As you review your app, be sure to check out our new tags API!

Reminder: Tokens & Permissions

As a reminder, the Dropbox OAuth flow is beginning to default to returning short-lived access tokens. This token_access_type will default to online when the parameter is unspecified in the auth URL. This change to the default is being rolled out gradually.

Existing long-lived access tokens are not impacted, and remain valid.

Apps that require background access will need to be updated to use refresh tokens, which is made easier by using our updated SDKs. All other apps should ensure that users are directed to re-authorize upon token expiration.

For detailed instructions, please see:

Reminder: TLS 1.0 & 1.1 Deprecation

Beginning January 3rd 2022, the Dropbox API will require that calls use TLS 1.2 or greater. Traffic using TLS 1.0 or 1.1 will be rejected.

The latest Dropbox SDKs will select TLS 1.2 when available in the environment, but versions over two years old may require update. In particular, users of the Dropbox Java SDK should update to v3.1.1 (released June, 2019) or later & Dropbox Python SDK should update to v8.4.1 (released November, 2017) or later.

Typically no other action is required for applications built with up-to-date libraries in modern environments. TLS 1.2 has been the default on major mobile & desktop operating systems since 2014. Developers whose application may be run in older or unusual environments should investigate to ensure compatibility.

Platform Update: Tags API in Preview

Dropbox users can now use tags to organize & search content. See the feature announcement here, and our help center page on using them here.

APIs for tags are now available for preview. You may now add, remove, and get these tags! Tags are alphanumeric strings, up to 32 characters. A file may have up 20 tags.

Note that these tags are visible to all users with access to the file on the Dropbox.com. If your wish tags to be private to your application via API, use the file properties API instead.

As always, if you have any questions, visit our developer forum or submit a ticket.

Thanks,
The Dropbox Platform Team

Interesting, haven’t had that email and all still working here. Maybe try recreating the token and try again.

There is an issue in the repo above where I show my scripts to use dropbox. The addon was giving errors in HA a long time ago so I switched to my scripts

@DavidFW1960 , do I understand your comment to mean that you have a script that does your backups to dropbox independent of the two, now broken, dropbox upload add-ons?

If so, could you share?
Thanks

Yes that is what I mean. I did provide full info in the issue raised for the addon. It’s been a while but I will see if I can find it

I was using this Add-on but it recently stopped working due to it not supporting the use of short lived tokens that Dropbox moved to.

I’ve developed my own Add-on to replace it:

8 Likes

Looks great that’s for that

@diffhome Thank you for this. It works great.

One issue I’m trying to fix, which someone might have some insight on…

I run an automation every night to create a full HA Backup and then to run Mr. Hadley’s Dropback add-on, which “syncs” my backups to my Dropbox. The minor issue I’m running into is that HA doesn’t “wait” while the backup is created, so the latest backup is never synced with Dropback. Does anyone have a solution to force the automation to pause until the backup is completed?

(Of course, this can be accomplished with a “hard-coded” delay of X seconds, but that’s no fun! :grin:)

I just tried your addon and it works great, thanks!

Thank you Matt!

Feature request for two sensors:

  • last timestamp a successful sync (upload) occurred where backup files were transferred
  • the file timestamp of the most recent .tar file uploaded

This can allow setting up alerts/notifications if the backup mechanism stops working for some unknown reason. I didn’t even notice that backups were not being uploaded with the old add-on for quite some time.

Thanks @ryans, these seem like good suggestions. I will have to read up about creating a sensor from an add-on.

Feel free to raise github issues for requests as well - I only just saw your post here.

I’ve just released version 5.2.0 that populates 2 entities:

  • dropback.status - will be OK if ok and Error if not. The timestamp attribute is updated on each successful file sync.
  • dropback.sync - shows current file being sync’d (so the logbook view will show a history of sync’d files)

I’ve just pushed 6.0.0 which adds a last entity - with the last file sync’d. Dropback now operates on files in a predictable order, so last should be the most recent backup that was made that was syn’d.

1 Like

Works like a charm! Cheers Mate!

Out of interest, how are you all calling the service to kick off the sync? Running a schedule?

Thank you Matt, It works like a charm

Thanks for your efforts @diffhome. I’ve tried several different automations, but so far have failed to

  1. Automatically delete old backups and
  2. Automatically sync backups anywhere off HA.
    Unfortunately, I’m having no more luck with your automation. Backup works fine but no syncing with dropbox and no removal of old files. Config is all set up fine with dropbox settings so far as I can see.

Traces don’t show anything useful. Have tried using Developer Tools to run just the following part of the automation:

service: hassio.addon_stdin
data:
  addon: 719b45ef_dropback
  input: sync

I get a green tick, but no backup turns up in dropbox.

Adding this to the end of my automation:

 - service: notify.notify
    data:
      message: >-
         {{ states ("sensor.dropback_status") }}
mode: single

Just produces the message =“error”.
Any other way that I can debug to try and work out what’s going wrong?

Wondering if this might be an issue with file ./ folder permissions?

Thanks

@yebaws sorry to hear you’re having trouble. When you run dropbak via the developer tools service call, what output do you see in the “Log” tab of the add-on? Any captured errors should show up in there