Crates.io | inventorize |
lib.rs | inventorize |
version | 0.1.1 |
source | src |
created_at | 2021-01-29 19:32:44.23813 |
updated_at | 2021-01-29 19:52:10.207959 |
description | A command-line file integrity verification tool |
homepage | https://github.com/rdmitr/inventorize |
repository | https://github.com/rdmitr/inventorize |
max_upload_size | |
id | 348208 |
size | 50,945 |
inventorize
is a command-line tool for data integrity verification.
In a nutshell, inventorize
builds an inventory of files in a directory
(the repository). The inventory contains the paths and the hashes of the
files. Later, inventorize
can be used to compare the inventory records with
the actual contents of the repository and verify the integrity of the files by
comparing their hashes with the hashes stored in the inventory.
Using inventorize
boils down to three operations:
The inventory file must not be stored inside the repository directory.
For the detailed description of the available command-line options and commands, see the reference below.
Use the build
subcommand to build the inventory:
inventorize
--repository /path/to/the/repo
--inventory /path/to/the/inventory.json
build
Use the verify
subcommand to verify the contents of the repository using an
existing inventory file:
inventorize
--repository /path/to/the/repo
--inventory /path/to/the/inventory.json
verify
Use the update
subcommand to update the inventory when files are added to the
repository:
inventorize
--repository /path/to/the/repo
--inventory /path/to/the/inventory.json
update
--repository
: path to the repository (defaults to the current working
directory).--inventory
: path to the inventory file.--verbose
: verbose mode.build
subcommandThe build
subcommand is used to build the inventory.
By default this subcommand will include hidden files in the inventory. It will report an error if the inventory file exists.
The default hash algorithm is md5
. Particularly paranoid users can select
multiple hash algorithms:
--hash-algorithm=md5 --hash-algorithm=sha1
Supported options:
--overwrite
: overwrite the inventory file if it exists.--skip-hidden
: do not include hidden files in the inventory.--hash-algorithm=<ALG>
: hash algorithm to use.Supported hash algorithms:
md5
sha1
verify
subcommandThe verify
subcommand is used to verify the repository contents using an
existing inventory. An error is returned if any missing, added, or changed files
are found.
By default, all hash values contained in the inventory are checked. Alternatively, the quick mode can be enabled to only check the presence of files and their sizes. Needless to say, this mode should not be considered a reliable integrity check.
Supported options:
--quick
quick mode: only check presence of files and their sizes.update
subcommandThe update
subcommand updates the inventory with files added to the repository
after the inventory has been built. It never recomputes the hashes of the
existing inventory records.
Files that are gone from the repository but still present in the inventory are not removed from the inventory by default.
Supported options:
--remove-missing
: remove files that are no longer found in the repository
from the inventory.The inventory is stored as a JSON file that contains a list of records
(file paths and their hash values), as well as metadata (version of the
application used to build the inventory, and build
subcommand options).