dotbak

Lazily Backup Files and Directories


License
BSD-2-Clause-FreeBSD
Install
pip install dotbak==0.0.6b0

Documentation

dotBAK - Lazily Backup Files and Directories

Built on Cementâ„¢ Continuous Integration Status

Installation

$ pip install dotbak

Usage

$ dotbak README.md

$ dotbak README.md

$ dotbak README.md

|$ ls -lah README.md*
-rw-r--r--    1 user     user        2.4K Sep 12 12:10 README.md
-rw-r--r--    1 user     user        2.4K Sep 12 12:56 README.md.bak-2021-09-30-17:23:45
-rw-r--r--    1 user     user        2.4K Sep 12 12:56 README.md.bak-2021-09-30-17:23:57
-rw-r--r--    1 user     user        2.4K Sep 12 12:56 README.md.bak-2021-09-30-17:24:14

Development

This project includes a number of helpers in the Makefile to streamline common development tasks.

Environment Setup

The following demonstrates setting up and working with a development environment:

Docker:

This project includes a docker-compose configuration that sets up all required services, and dependencies for development and testing. This is the recommended path for local development, and is the only fully supported option.

The following creates all required docker containers, and launches an BASH shell within the dotbak dev container for development.

$ make dev

|> dotbak <| src #

The above is the equivalent of running:

$ docker-compose up -d

$ docker-compose exec dotbak /bin/bash

Testing Alternative Versions of Python

The latest stable version of Python 3 is the default, and target version accessible as the dotbak container within Docker Compose. For testing against alternative versions of python, additional containers are created (ex: dotbak-py37, dotbak-py38, etc). You can access these containers via:

$ docker-compose ps
        Name                      Command               State     Ports
-------------------------------------------------------------------------
dotbak_dotbak-py36_1   /bin/bash                        Up
dotbak_dotbak-py37_1   /bin/bash                        Up
dotbak_dotbak-py38_1   /bin/bash                        Up
dotbak_dotbak_1        /bin/bash                        Up


$ docker-compose exec dotbak-py37 /bin/bash

|> dotbak-py37 <| src #

VirtualEnv:

### create a virtualenv for development

$ make virtualenv

$ source env/bin/activate


### run dotbak cli application

$ dotbak --help


### run pytest / coverage

$ make test

Releasing to PyPi

Only for official maintainers.

Before releasing to PyPi, you must configure your login credentials:

~/.pypirc:

[pypi]
username = __token__
password = YOUR_PYPI_API_TOKEN

Then use the included helper function via the Makefile:

$ make dist

$ make dist-upload

Deployments

Docker

Included is a basic Dockerfile for building and distributing dotBAK, and can be built with the included make helper:

$ make docker

$ docker run -it datafolklabs/dotbak:latest --help

License

dotBAK is Open Source and is distributed under the BSD License (three clause). Please see the LICENSE file included with this software.