Project

rcloner

0.0
No commit activity in last 3 years
No release in over 3 years
Simple backup tool based on Rclone
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0
~> 0.3.1
>= 0
 Project Readme

Rcloner

README in progress. Project is on the early stage, use it at your own risk.

Simple wrapper for Duplicity (with optional Rclone backend) which allows to sync/restore your application files/database from a remote storage. All files stored on a remote storage are encrypted and backups are incremental, thanks to Duplicity.

Example config (rcloner.yml)

origin: /home/deploy/myapp
destination: webdavs://login:pass@webdav.yandex.ru/myapp_backup
include:
  - 'public/images'
  - 'config/master.key'
  - '.env'
  - 'tmp/db.dump'
on_backup:
  before: 'postgressor dumpdb tmp/db.dump'
  after: 'rm tmp/db.dump'

Where:

  • origin is the root folder path if your application. If not provided - current directory will be taken. Can be also provided as RCLONER_ORIGIN env variable.
  • destination - remote path in dyplicity format. Can be also provided as env variable RCLONER_DESTINATION.
  • include if provided - only this paths will be taken for backup, not the whole origin. Urls should be provided in relative paths to origin folder.
  • on_backup (before/after) custom optional commands/scripts to execute before/after backup. Commands will be executed into origin directory.

Note that rcloner by default loads env variables from .env file (if exists) in current category.

Installation

1) Install rclone:

$ curl https://rclone.org/install.sh | sudo bash

2) Install duplicity, minimal supported version is 0.8.09. If you're using Ubuntu, the most simple way to install latest version is via snap:

$ sudo snap install duplicity --classic

3) Install gem rcloner:

$ gem install rcloner

Or you can install gem directly from github using specific_install:

$ gem install specific_install
$ gem specific_install https://github.com/vifreefly/rcloner

Another option is to add gem to your application Gemfile:

gem 'rcloner', git: 'https://github.com/vifreefly/rcloner', require: false

Usage

Readme in progress...

backup

To sync all items from local to remote rclone storage use backup command:

deploy@server:~/my_app$ rcloner backup --config rcloner.yml

restore

To sync all items from remote rclone storage to local server use restore command:

deploy@server:~/my_app$ rcloner restore --config rcloner.yml

How to run backup with a cron

Use Whenewer gem.

Notes

License

The gem is available as open source under the terms of the MIT License.