Giter Site home page Giter Site logo

duplicatidropboxchecker's Introduction

Duplicati Dropbox Checker

Simple Python script to check if backups created by Duplicati are correctly present at Dropbox (if that target was selected).

Outputs data in format acceptable by Prometheus that include path on Dropbox and timestamp of newest file in provided directory with Duplicati backups.

Setup

python3 -m pip install -r requirements.txt

Usage

./ddc.py DROPBOX_API_TOKEN PROMETHEUS_ALIAS PATH_ON_DROPBOX
  • PATH_ON_DROPBOX is full path to directory on Dropbox, eg. "/Applications/Duplicati backup/COMPUTER_ONE/C_DRIVE"
  • PROMETHEUS_ALIAS is any ASCII alphanumeric string that'll be appended as metric sufix
  • DROPBOX_API_TOKEN is non-expiring read-only token to Dropbox API

How to generate DROPBOX_API_TOKEN

  1. Go to Dropbox App Console - https://www.dropbox.com/developers/apps
  2. Click Create App
    1. Select Scoped access
    2. Select Full Dropbox since we will be accessing data of other application
    3. Provide some name - must be globally unique accross all Dropbox application, but can be random string
  3. In page you are taken to after creation of application go to tab Permissions
    1. Navigate to Individual Scopes
    2. Find Files and folders
    3. Select checkbox files.metadata.read
    4. Click Submit
  4. In the same page go to tab Settings
    1. Navigate to OAuth 2
    2. In Access token expiration dropdown select No expiration (this should be fixed in future)
    3. Find section Generated access token
    4. Click Generate
    5. Store API token in safe place

Typical application

It was created with cron daily execution in mind that stores files consumed by collector.textfile in prometheus_nodexporter.

Example output

$ ./ddc.py XXXXXXXXXXXXXXXXXXXXXXXX ComputerOneCDrive "/Applications/Duplicati backup/COMPUTER_ONE/C_DRIVE"
dropbox_duplicati_latest_file_ComputerOneCDrive 1611363686

duplicatidropboxchecker's People

Contributors

danielskowronski 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.