r2sync

Crates.ior2sync
lib.rsr2sync
version0.0.4
sourcesrc
created_at2024-10-13 16:42:42.870689
updated_at2024-10-15 03:37:27.981242
descriptioncli for synchronizing files between a local directory and Cloudflare R2
homepage
repository
max_upload_size
id1407473
size106,673
Masayuki Matsuki (Songmu)

documentation

README

r2sync

Test Status License Crates.io Documentation

r2sync is a command-line tool for synchronizing files between a local directory and Cloudflare R2. It allows seamless syncing of files to and from your R2 bucket.

Features

  • Sync local directories with Cloudflare R2 buckets.
  • For efficient sync, look at the eTag and content length of the remote file and skip the put appropriately.

Installation

$ brew install Songmu/tap/r2sync

You can build and install the latest version from the source code. Ensure you have Rust installed, and then run:

$ cargo install r2sync

Alternatively, you can clone the repository and build the project locally:

$ git clone https://github.com/Songmu/r2sync.git
$ cd r2sync
$ cargo build --release

Usage

Once installed, you can start syncing files by using the r2sync command.

Basic Usage

r2sync ./localdir r2://bucket.example.com/dir

This will sync the contents of ./localdir to the R2 bucket at r2://bucket.example.com/dir.

Syncing from R2 to Local Directory

To sync files from R2 to a local directory:

r2sync r2://bucket.example.com/dir ./localdir

Full Command Line Options

  • --public-domain: If a public domain is specified, the remote content is checked before the file is put out, and if it is identical, the put is skipped.

Configuration

You can provide authentication details via environment variables.

Environment Variables

export R2_ACCOUNT_ID=<your-account-id>
export R2_ACCESS_KEY_ID=<your-access-key>
export R2_SECRET_ACCESS_KEY=<your-secret-key>

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contribution

Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.

Contact

For any questions or issues, feel free to open an issue on the GitHub repository or reach out via email at y.songmu@gmail.com.

Commit count: 0

cargo fmt