Git Product home page Git Product logo

unifi-cloudkey-dropbox-backups's Introduction

Unifi CloudKey backups

Automatically upload your Unifi CloudKey backups to Dropbox.

TODO: Right now we upload every file every time and let Dropbox handle the de-duplication (mode:add). We should be de-duping here to lower bandwidth usage and improve performance.

USAGE:

  1. Create a Dropbox app ("Unifi CloudKey") at https://www.dropbox.com/developers/apps/create.
  2. Create a folder ("/backups") for your app.
$ curl -X POST https://api.dropboxapi.com/2/files/create_folder_v2 \
--header "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
--header "Content-Type: application/json" \
--data "{\"path\": \"/backups\",\"autorename\": false}"

Run it on the CloudKey. The response should look like this -

{"metadata": {"name": "backups", "path_lower": "/backups", "path_display": "/backups", "id": "id:YYYYYYYYYYYYYYY"}}
  1. Get and chmod the backup script -
$ wget -O /usr/bin/CloudKey-Dropbox-backups.sh \
https://raw.githubusercontent.com/Gestas/Unifi-CloudKey-Dropbox-backups/master/CloudKey-Dropbox-backups.sh $$ \
chmod +x /usr/bin/CloudKey-Dropbox-backups.sh
  1. Add a task to cron. My CloudKey creates a backup everyday at 4PM so I run this upload script at 5 -
$ crontab -e
# Add - 
0 17 * * * "/usr/bin/CloudKey-Dropbox-backups.sh <token>"

NOTE: The token string should not include "Bearer"

You can run the script manually to make sure it works -

$ CloudKey-Dropbox-backups.sh <token>

unifi-cloudkey-dropbox-backups's People

Contributors

gestas avatar

Watchers

 avatar  avatar

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.