r/rclone • • Jul 04 '21

Python Rclone Backup Script with Telegram, InfluxDB and Grafana Reporting

Hey guys :)

I created a small Python Rclone Backup Script for personal use. I wanted to step up my Rclone game and get statistics and backup summaries in Telegram and Grafana.

You can find the script here: https://gist.github.com/lucanello/1fa285804dff2eeb681d3a86f64cc03b

Grab the Grafana dashboard from here: https://grafana.com/grafana/dashboards/14686

I use the Python subprocess.run() command to execute the rclone commands.

Features:

  • You can execute scripts, commands and database dumps before running a single rclone command

  • It sends automatic error reports and summaries

  • It saves all statistics and operations to an Influx database

  • The data can be used for visualizations in e.g. Grafana

  • You can automate it by using cron

Examples:

Please leave some feedback and help me improve this script! :-)

Thanks and have fun!

41 Upvotes

9 comments sorted by

View all comments

1

u/jtm2020hyo Mar 26 '22

looks interesting, where can I use this script?

How can I run a rclone command since python?

1

u/lucanello Mar 26 '22

Simply copy the script from the URL and configure your settings (InfluxDB, sources and targets for file transfers). You'll need to install the Python dependencies and are good to go :-) Some more details can be found in this comment: https://gist.github.com/lucanello/1fa285804dff2eeb681d3a86f64cc03b?permalink_comment_id=3904093#gistcomment-3904093 Feel free to ask if you need further assistance.