Skip to main content

A command-line tool to easily create backups of selected folders or files.

Project description

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.

  1. 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)
  2. Navigate into the root of the repository.
  3. 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

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

box-cmd-2.0.1.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

box_cmd-2.0.1-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file box-cmd-2.0.1.tar.gz.

File metadata

  • Download URL: box-cmd-2.0.1.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for box-cmd-2.0.1.tar.gz
Algorithm Hash digest
SHA256 b62dfabd4e21ea463315349678879aa4d0adf40ffbdfae4f5359d4f26c2ad374
MD5 0f1a4a8f8e1f2b93e5b3cab268e7334b
BLAKE2b-256 63fc24362913929d85e85b335628a1d5c14d268d373c2e9e83b17be4f9f55a31

See more details on using hashes here.

File details

Details for the file box_cmd-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: box_cmd-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for box_cmd-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3293eca1bc0c3b70947b34d698786303964f9da86f2309b71f5bb823c4782d00
MD5 32001620efdc07bf200e12cf49e66c0d
BLAKE2b-256 7fb59ec2279e2e939d78b21310190b1fecedd0b4723730ab1cc06d10bb6cbc1e

See more details on using hashes here.

Supported by

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