Coder Social home page Coder Social logo

backbacker's Introduction

BackBacker - A light backup tool.

BackBacker is a light backup tool with a batch file based on simple commands with arguments.

Concept

Job script with one instruction per line:

$ cat examples/job.bb
git_bundle -r /tmp/git_repo -d /tmp
hg_bundle -r /tmp/hg_repo -d /tmp

Run backup job:

$ backbacker.py batch examples/batch.bb

Additional you can run or use each command in your own script by using it as a sub-command:

$ backbacker.py git_bundle -r /tmp/git_repo -d /tmp
$ backbacker.py hg_bundle -r /tmp/hg_repo -d /tmp

Installation & Usage

  • Clone repository:
$ git clone https://github.com/cpieloth/BackBacker.git BackBacker
  • Install BackBacker:
$ cd BackBacker
$ python3 setup.py install
  • Create a config (optional):
$ cp examples/config.ini examples/myconfig.ini
$ editor examples/myconfig.ini
  • Create a backup batch:
$ cp examples/batch.bb examples/batch.bb
$ editor examples/batch.bb
  • Run your backup job
$ backbacker batch -c examples/config.ini examples/batch.bb
  • Create a cron job (optional):
$ crontab -e

backbacker's People

Contributors

cpieloth avatar

Watchers

 avatar  avatar

backbacker's Issues

GitHub REST-API broken

  • git clone via git protocol fails
  • instead use of https
  • use clone_url in REST API
  • check for other changes

Create a Singleton Config Object

For commands it should be possible to request commands parameters at anytime without knowing the logic behind the file reading and creating config object.
A singleton pattern which reads a config file on first call is to be implemented, file name is an optional parameter.

Investigate duplicity

  • Can BackBacker be transformed to plugin collection for duplicity?
  • Can BackBacker create a duplicity wrapper?
  • ...

Refactor Command Parsing using Argparse

Refactor command class with its instance(cls, params) and prototype(cls) methods.

  • prototype(cls) can be removed, because a class object can be used instead.
  • instance(cls, params) should use argparse and should be renamed
  • command should support external use as sub parser, set default func
  • Job file format is then in "CLI format", e.g. git_bundle --src /git/foo --dest /tmp
  • Job can may use argparse to check which command has to be triggered
  • Job may become a task which reads and executes a job file

Benefits:

  • argparse can produce help text
  • argparse can check arguments (required, ...)
  • opportunity to use sub commnd
  • opportunity to create entry points for CLI access

Create a Build System

Create a simple build system using Make. Following targets are desired:

  • make doc, make doc_manual (AsciiDoc/Markdown), make doc_api (Sphinx)
  • make check_code (pylint)
  • make package (trigger setup.py)
  • make test (unittest)
  • make clean

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.