Skip to main content

Creates backups of your files and directories.

Project description

bkp

Github - Tests PyPI - Version PyPI - License PyPI - Downloads

Simple utility that makes backups of your files/directories.

Features

  • Work with separate files or entire directories.
  • Creates simple copy or TAR archive.
  • Optionally append metadata: author, creation time, commit message (applies only to TAR archives).

Installation

pip install bkp

Compatibility

  • This software is expected to work with Python 3.6, 3.7 and compatible.
  • It has never been tested under operating systems other than Linux.
  • For editing messages interactively (-M switch) you need either have vi installed, or set EDITOR system variable to relevant value.

Usage

Creating Backups & Restoring

Provided that we have a file or directory: foo/bar/baz

# Create a copy:   
bkp foo/bar/baz

# Following copy will be created: foo/bar/baz.b01
# Invoking command again will create foo/bar/baz.b02 etc.

# Restore your file or directory:
bkp -r foo/bar/baz.01

# This will create/overwrite original file/directory: foo/bar/baz

Note that multiple files can be specified in the command line. Output files are always created in the same directory where corresponding input files are located, no matter what CWD at the time.

Working With Archives

Alternatively -a flag can be used to create tar archive instead of a simple copy. Also -m can be used to add comments.

# Create an archive
bkp -am "initial version" foo/bar/baz

# Comment and other details can be obtained by invoking:
bkp -i foo/bar/baz.b03

For more options and explanations invoke bkp --help.

Development

Preparing environment:

python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements-dev.txt
python3 -m pip install -e .

Modifying dependencies:

# edit setup.py
# edit requirements*.in
pip-compile
pip-sync
# git add... commit... push...

Testing:

pytest

Releasing:

echo $VERSION > bkp/VERSION
twine upload dist/bkp-$VERSION.tar.gz
git tag $VERSION
git push --tags

Disclaimer

Author doesn't take any responsibility for loss or damage caused by this utility. You are using it on your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bkp-1.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bkp-1.0.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file bkp-1.0.0.tar.gz.

File metadata

  • Download URL: bkp-1.0.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-56-generic

File hashes

Hashes for bkp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0ab68bc0f7f20340e324d36974df71c0d9c74895946a0d2ae9c19640fb4e1877
MD5 2eaa8a40360b1021fa6e7209e2473aab
BLAKE2b-256 8e19210dd1d56f692b593458dfe031e1f8ca3d2191e32e6484157a63fe1a74b7

See more details on using hashes here.

File details

Details for the file bkp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bkp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-56-generic

File hashes

Hashes for bkp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d56aaba86873ce19a53745bed3a48787ff4263c8bff2af2e69c41391b8710b08
MD5 2f76d5c2f502d4d3380a158a87facc7d
BLAKE2b-256 dc5c52737a607331a19ed0d8cc15d61e365003d64d33f8fe68bef0e8df24fded

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page