Skip to content

Gestas/Unifi-CloudKey-Dropbox-backups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

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>

About

Copy your Unifi Cloudkey backups to Dropbox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages