GithubHelp home page GithubHelp logo

back-up's Introduction

back-up

https://github.com/Czaporka/back-up/actions codecov

Description

back-up is a very simple utility for backing up directories of files.

Features

  • Awfully simple.
  • Configured with a YAML configuration file, where you can specify what directories should be backed up, and where the backups should be stored.
  • For each directory to back up, it checks whether its contents have changed since the last time it was backed up. If not, then back-up will not waste disk space by creating another copy. This means that it can simply be called at regular intervals, e.g. scheduled with cron or Task Scheduler to run every 1 hour or so.

Installation

pip install back-up

Configuration

back-up reads the configuration from file ~/.config/back-up/back-up.yaml. That is where you should specify all the directories you want backed up. See sample back-up.yaml file for available configuration options.

It is also possible, albeit usually impractical, to specify all the parameters on the command line.

Usage

usage: back-up [-h] [--backups-dir PATH] [--log-file PATH]
               [--logging-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}]
               [--to-backup NAME=PATH [NAME=PATH ...]] [--config-file PATH]
               [--archive-format FORMAT] [--version] [--verbose] [--quiet]

Utility for backing up directories.

optional arguments:
  -h, --help            show this help message and exit
  --backups-dir PATH    set the directory to dump the backups to; this is the
                        'general' backups directory, i.e. specific
                        directories that you back up will have their own
                        subdirectories in there
  --log-file PATH       set the file to dump logs to
  --logging-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}
                        set logging verbosity
  --to-backup NAME=PATH [NAME=PATH ...]
                        set the directories to back up; PATH is the directory
                        to back up, NAME is an arbitrary identifier used to
                        organize the backup files in the backup directory, so
                        it's easier to find the thing you want to restore;
                        sample value: 'DOCUMENTS=~/Documents' (the tilde will
                        be expanded appropriately, backups will be dumped
                        under '<backups_dir>/DOCUMENTS/...')
  --config-file PATH    where to take config from; command line arguments
                        have priority though; default: '~/.config/back-
                        up/back-up.yaml'
  --archive-format FORMAT
                        what format to store the backups in; default: 'zip'
  --version, -V         show version and exit
  --verbose, -v         increase verbosity of console output
  --quiet, -q           decrease verbosity of console output

Development

Prepare environment

python3 -m venv .env
source .env/bin/activate
pip install --editable .
pip install coverage pycodestyle

Run tests, generate coverage reports etc.

coverage run --source back_up/ -m unittest discover tests/
coverage report
coverage html
pycodestyle back_up/ tests/

# same thing but on one line:
coverage run --source back_up/ -m unittest discover tests/ \
  && coverage report \
  && coverage html \
  && pycodestyle back_up/ tests/

TODO

  • Add some sort of cleanup capability for really old backups.

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.