r2sync
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:
Usage
Once installed, you can start syncing files by using the r2sync
command.
Basic Usage
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:
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
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.