3 releases (breaking)
0.3.0 | Mar 1, 2022 |
---|---|
0.2.0 | Feb 26, 2022 |
0.1.0 | Feb 11, 2022 |
#15 in #bag
77KB
2K
SLoC
bagr
bagr
is a command line utility for interacting with
BagIt bags.
It is still under active development, but bag creation is feature complete.
Install
Pre-built
The releases page has pre-built binaries that should work on common OSes and architectures. You do not need to install Rust to use them.
- Download and unzip the appropriate binary
- Execute
./bagr help
to verify it works
Local Build
- Install Rust
- Execute:
cargo install bagr
- Verify the install:
bagr help
Usage
Create a new bag
By default, bagr
will turn the contents of the current directory
into a bag by invoking:
bagr bag .
If instead, you'd like to create a bag by copying the contents of a source directory into a destination bag, then you can do by invoking:
bagr bag src/dir dst/bag
By default, sha512
is used; this algorithm can be changed using the
--digest-algorithm
option.
On Mac systems, .DS_Store
files can often sneak into unwanted
places. These files can be excluded from the bagging process by using
the --exclude-hidden-files
flag. Note this will delete hidden
files when creating a bag in place.
Update an existing bag
If you've modified the payload or tag files of a bag after creating
it, bagr
can also be used to recompute all of the digests and update
the appropriate manifest files by executing the following:
bagr rebag path/to/bag
By default, it will use the same digest algorithms as were originally
used in the bag. If you wish to change the algorithms, you can do so
by specifying the --digest-algorithm
option.
Limitations
- Tag files must be UTF-8 encoded
fetch.txt
is not supported- BagIt versions prior to 1.0 are not supported
Roadmap
- Implement bag validation
- Support
fetch.txt
- Support BagIt 0.97
- Support BagIt Profiles
- Support non-UTF-8 character encodings
Dependencies
~8–18MB
~218K SLoC