BOX
Box is a command line tool that enables the easy creation of rolling backups using user-defined presets.
Installation
Pre-Installation
Ensure you have the following tools configured and working on your machine.
- Python (3.7 or greater)
- Git
Follow these steps to install this utility.
- Clone the repository using git:
git clone https://github.com/InValidFire/backup_cmd.git(https)git clone git@github.com:InValidFire/backup_cmd.git(ssh)
- Navigate into the root of the repository.
- Use pip to install the package locally.
python -m pip install .
Note: Depending on your system's configuration, the exact commands to run may vary.
Post-Installation and Configuration
BOX loads a file in your HOME directory called .box_config.json, it should have the following structure:
{
"format": 1,
"presets": {
"<preset_name>": {
"targets": [
"C:\\Target\\Path\\One",
"C:\\Target\\Path\\Two"
],
"destinations": [
{
"path": "E:\\Destination\\Path",
"file_format": "zip",
"name_separator": "-",
"date_format": "%d_%m_%y__%H%M%S",
"max_backup_count": 10
}
]
}
}
}
If you'd like to see the JSON Schema used to validate this file, see here: presets.json JSON Schema
Usage
box list - list all presets found in the config file.
box pack [--force] [--keep] <preset> - create a backup using the preset. if the force flag is set, force the backup creation even if it was already saved. if the keep flag is set, keep backups beyond the max_backup_count.
box unpack --source=<preset|backups_folder> [--destination <destination_path>] - select a backup to restore from the preset or backups_folder path. The backups_folder path should contain completed backups from the utility. If the destination is given, the original backup's target will not be used and the backup will instead be restored to the custom destination.
Development and Contribution
To run the program in a development environment, first install the program using pip.
pip install -e <repo-directory>
Then you can run the command under the box command name. :)
This program utilizes pytest for testing, with pytest-cov, ensure you have them both installed:
pip install pytest pytest-cov
To run all tests in the tests directory, run the following command in the repo root directory.
pytest --cov=box_cmd ./tests
If you'd like the report to be generated into an HTML document (for detailed information), run this command instead:
pytest --cov=box_cmd ./tests --cov-report=html
Metadata
Release files for box-cmd 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| box-cmd-2.0.3.tar.gz | 31.1 kB | Without provenance | Details for box-cmd-2.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| box_cmd-2.0.3-py3-none-any.whl | Python 3 | none | any | Details for box_cmd-2.0.3-py3-none-any.whl |
Total release size: 65.6 kB
Release files / box-cmd-2.0.3.tar.gz
| Download URL | box-cmd-2.0.3.tar.gz |
|---|---|
| Size | 31.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aecf5ee80c73f583f366bfddecb282636121e1d4078a1693974510d9c062c577
|
|
BLAKE2b-256 checksum How to use checksums |
d4e9a92c2ae29b9063ec221a0e4d17eae9000768ed919d6fe174e1702f226c28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / box_cmd-2.0.3-py3-none-any.whl
| Download URL | box_cmd-2.0.3-py3-none-any.whl |
|---|---|
| Size | 34.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
482875ade59a7bb2427a262db534ef681b23f8a42e7738f417585aa9159f873d
|
|
BLAKE2b-256 checksum How to use checksums |
e69921c0bcc0e6c4aa175f4c3b38ac35830850eccecfdb4fdef6ec6c0c6bcd9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for box-cmd 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.