2.3 KiB
registry-backup
A command line utility for downloading all .crate files hosted by a Cargo registry server.
Use cases:
- Backup: retrieve a registry server's files for backup storage
- Export: pull the files so you can host them at another registry server
Example Usage:
Specify the registry index either as a local path (--index-path
)...
$ git clone https://github.com/rust-lang/crates.io-index.git
$ RUST_LOG=info registry-backup \
--index-path crates.io-index \
--output-path crates.io-crate-files \
--requests-per-second 10
...or as an --index-url
instead:
$ RUST_LOG=info registry-backup \
--index-url ssh://git@ssh.shipyard.rs/shipyard-rs/crate-index.git \
--output-path shipyard-rs-crate-files \
--auth-token ${AUTH_TOKEN} # for private registry, need auth
Install
$ cargo install registry-backup --git https://git.shipyard.rs/jstrong/registry-backup.git
Runtime Options
$ ./target/release/registry-backup --help
{{ cli_menu }}
Configuration File
A toml configuration file may be used instead of command line flags. A sample file (config.toml.sample
) is included. From the example file:
{{ config_sample }}
Build From Source
$ git clone https://git.shipyard.rs/jstrong/registry-backup.git
$ cd registry-backup
$ just release-build # alternatively, cargo build --bin registry-backup --release
# ./target/release/registry-backup --help
# cp target/release/registry-backup ~/.cargo/bin/
Running Tests
$ just test # alternatively, cargo test
Justfile
The repository includes a justfile
with functionality for building, testing, etc.
Included commands:
$ just --list
{{ just_commands }}
The commands that mirror cargo commands (e.g. just test
) are included for the purpose of convenience, so that various options (e.g. RUSTFLAGS='-C target-cpu=native
) can be included without typing them out each time.
Generating README.md
This file is generated using a template (doc/README.tera.md
) rendered using updated outputs of the CLI menu, config sample, and other values.
This version of README.md
was generated at {{ generation_time }}
based on git commit {{ git_commit }}
.
To (re-)generate the README.md
file, use the justfile command:
$ just generate-readme