Crates.io | r2sync |
lib.rs | r2sync |
version | 0.0.4 |
source | src |
created_at | 2024-10-13 16:42:42.870689 |
updated_at | 2024-10-15 03:37:27.981242 |
description | cli for synchronizing files between a local directory and Cloudflare R2 |
homepage | |
repository | |
max_upload_size | |
id | 1407473 |
size | 106,673 |
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.
$ 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
Once installed, you can start syncing files by using the r2sync
command.
r2sync ./localdir r2://bucket.example.com/dir
This will sync the contents of ./localdir
to the R2 bucket at r2://bucket.example.com/dir
.
To sync files from R2 to a local directory:
r2sync r2://bucket.example.com/dir ./localdir
--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.You can provide authentication details via 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>
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.
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.