Giter VIP home page Giter VIP logo

dropbox-backup's Introduction

Home Assistant add-on: Dropbox backup

Last commit Commits per month License GitHub Workflow Status GitHub issues GitHub release (latest by date)

Supports armhf Architecture Supports armv7 Architecture Supports aarch64 Architecture Supports amd64 Architecture Supports i386 Architecture

Upload your Home Assistant backups to Dropbox.

๐Ÿ“„ About

This add-on allows you to upload your Home Assistant backups to your Dropbox, keeping your backups safe and available in case of hardware failure. Uploads are triggered via a service call, making it easy to automate periodic backups or trigger uploads to Dropbox via script as you would with any other Home Assistant service.

This add-on is inspired by Dropbox Sync from Daniel Welch. Major thanks for his work!

โคต๏ธ Installation

  1. Go to the Supervisor add-on store in Home Assistant.
  2. Click on the "three-dots-menu" and choose Repositories.
  3. Add this repository to your Home Assistant instance: https://github.com/mikevansighem/dropbox-backup.
  4. Install the Dropbox backup add-on.
  5. Configure the add-on with your Dropbox OAuth Token and desired output directory (see configuration below).

๐Ÿ— Configuration

Generate Dropbox access token

To access your personal Dropbox, this add-on requires an access token. Follow these steps to create an access token:

  1. Go to Your Dropbox apps.
  2. Click on Create App.
  3. Select Scoped Access and choose between full or app folder only access.
  4. Give your app a unique name and click on Create App.
  5. Now your app is created go to the permissions tab and tick files.metadata.write.
  6. Back on the settings tab, go to "Generated access token" and click Generate.
  7. Copy the access code for use in your configuration.

Setup the add-on

Once you have created the token, copy it into this add-on's configuration under the oauth_access_token label.

Parameter Required Description
oauth_access_token Yes The "app" access token you generated above via the Dropbox UI.
output No The target directory in Dropbox to which you want to upload. If left empty, defaults to /, which represents the top level of directory of your Dropbox.
keep_last No If set, the number of backups to keep locally. If there are more than this number of backups stored locally, the older backups will be deleted from local storage after being uploaded to Dropbox. If not set, no backups are deleted from local storage.
preserve filename No If set to true the backup filename will remain the original slug e.g. d6f0919b.tar otherwise the files will be renamed to the backup name e.g. My Backup 2020-01-23.tar.

Example configuration:

{
  oauth_access_token: "<YOUR_TOKEN>"
  output: "/hasssio-backups/"
  keep_last: 2
  preserve_filename: false
}

๐Ÿš€ Usage

Dropbox Sync uploads all backup files (specifically, all .tar files) in the Home Assistant /backup directory to a specified path in your Dropbox. This target path is specified via the outputoption. Once the add-on is started, it is listening for service calls.

After the add-on is configured and started, trigger an upload by calling the hassio.addon_stdin service with the following service data:

service: hassio.addon_stdin
data:
  addon: 782428ea_dropbox-backup
  input:
    command: upload

This triggers the dropbox_uploader.sh script with the provided access token. You can use Home Assistant automations or scripts to run uploads at certain time intervals, under certain conditions, etc.

A sample automation can be found here. To use it simply create a new automation and copy the YAML.

๐Ÿ“ License

This add-on is covered under the MIT license refer to LICENSE.md for details.

dropbox-backup's People

Contributors

afewcc avatar dependabot[bot] avatar mikevansighem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

afewcc vdvmichel

dropbox-backup's Issues

Error "Unable to refresh access token without refresh token and app key"

The token generated from the Dropbox dashboard seems to only last for a short time, causing the uploads to fail after that, as it doesn't have the info to create a new token.

Log:

[Info] Received message with command upload
Unable to refresh access token without                 refresh token and app key
[INFO] Found 10 file(s) to upload.
[DEBUG] Creating a Dropbox object.
[ERROR] Invalid access token; try re-generating an access token from the app console on the web.
[Info] Keep last option is set, cleaning up files...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.