# bkp
![Github - Tests](https://github.com/gergelyk/bkp/actions/workflows/tests.yml/badge.svg)
![PyPI - Version](https://img.shields.io/pypi/v/bkp)
![PyPI - License](https://img.shields.io/pypi/l/bkp)
![PyPI - Downloads](https://img.shields.io/pypi/dm/bkp)
Simple utility that makes backups of your files/directories.
![](docs/demo.gif)
## 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
```python
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`
```sh
# 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:
```sh
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:
```sh
# edit setup.py
# edit requirements*.in
pip-compile
pip-sync
# git add... commit... push...
```
Testing:
```sh
pytest
```
Releasing:
```sh
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/gergelyk/bkp",
"name": "bkp",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "backup",
"author": "Grzegorz Krason",
"author_email": "grzegorz.krason@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8e/19/210dd1d56f692b593458dfe031e1f8ca3d2191e32e6484157a63fe1a74b7/bkp-1.0.0.tar.gz",
"platform": null,
"description": "# bkp\n![Github - Tests](https://github.com/gergelyk/bkp/actions/workflows/tests.yml/badge.svg)\n![PyPI - Version](https://img.shields.io/pypi/v/bkp)\n![PyPI - License](https://img.shields.io/pypi/l/bkp)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/bkp)\n\n\nSimple utility that makes backups of your files/directories.\n\n![](docs/demo.gif)\n\n## Features\n\n* Work with separate files or entire directories.\n* Creates simple copy or TAR archive.\n* Optionally append metadata: author, creation time, commit message (applies only to TAR archives).\n\n## Installation\n\n```python\npip install bkp\n```\n\n## Compatibility\n\n* This software is expected to work with Python 3.6, 3.7 and compatible.\n* It has never been tested under operating systems other than Linux.\n* For editing messages interactively (``-M`` switch) you need either have `vi` installed, or set ``EDITOR`` system variable to relevant value.\n\n## Usage\n\n### Creating Backups & Restoring\n\nProvided that we have a file or directory: `foo/bar/baz`\n\n```sh\n# Create a copy: \nbkp foo/bar/baz\n\n# Following copy will be created: foo/bar/baz.b01\n# Invoking command again will create foo/bar/baz.b02 etc.\n\n# Restore your file or directory:\nbkp -r foo/bar/baz.01\n\n# This will create/overwrite original file/directory: foo/bar/baz\n```\n\nNote 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.\n\n### Working With Archives\n\nAlternatively `-a` flag can be used to create tar archive instead of a simple copy. Also `-m` can be used to add comments.\n\n```\n# Create an archive\nbkp -am \"initial version\" foo/bar/baz\n\n# Comment and other details can be obtained by invoking:\nbkp -i foo/bar/baz.b03\n```\n\nFor more options and explanations invoke `bkp --help`.\n\n\n## Development\n\nPreparing environment:\n\n```sh\npython3 -m venv venv\nsource venv/bin/activate\npython3 -m pip install -r requirements.txt\npython3 -m pip install -r requirements-dev.txt\npython3 -m pip install -e .\n```\n\nModifying dependencies:\n\n```sh\n# edit setup.py\n# edit requirements*.in\npip-compile\npip-sync\n# git add... commit... push...\n```\n\nTesting:\n\n```sh\npytest\n```\n\nReleasing:\n\n```sh\necho $VERSION > bkp/VERSION\ntwine upload dist/bkp-$VERSION.tar.gz\ngit tag $VERSION\ngit push --tags\n```\n\n## Disclaimer\n\nAuthor doesn't take any responsibility for loss or damage caused by this utility. You are using it on your own risk.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Creates backups of your files and directories.",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/gergelyk/bkp",
"Repository": "https://github.com/gergelyk/bkp"
},
"split_keywords": [
"backup"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dc5c52737a607331a19ed0d8cc15d61e365003d64d33f8fe68bef0e8df24fded",
"md5": "2f76d5c2f502d4d3380a158a87facc7d",
"sha256": "d56aaba86873ce19a53745bed3a48787ff4263c8bff2af2e69c41391b8710b08"
},
"downloads": -1,
"filename": "bkp-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2f76d5c2f502d4d3380a158a87facc7d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 9409,
"upload_time": "2024-12-16T11:00:01",
"upload_time_iso_8601": "2024-12-16T11:00:01.152463Z",
"url": "https://files.pythonhosted.org/packages/dc/5c/52737a607331a19ed0d8cc15d61e365003d64d33f8fe68bef0e8df24fded/bkp-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8e19210dd1d56f692b593458dfe031e1f8ca3d2191e32e6484157a63fe1a74b7",
"md5": "2eaa8a40360b1021fa6e7209e2473aab",
"sha256": "0ab68bc0f7f20340e324d36974df71c0d9c74895946a0d2ae9c19640fb4e1877"
},
"downloads": -1,
"filename": "bkp-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "2eaa8a40360b1021fa6e7209e2473aab",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 7704,
"upload_time": "2024-12-16T11:00:05",
"upload_time_iso_8601": "2024-12-16T11:00:05.029262Z",
"url": "https://files.pythonhosted.org/packages/8e/19/210dd1d56f692b593458dfe031e1f8ca3d2191e32e6484157a63fe1a74b7/bkp-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 11:00:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gergelyk",
"github_project": "bkp",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "bkp"
}