Classic rsync re-implementation in pure Rust, targeting wire-compatible protocol 32 and near drop-in CLI/daemon behavior, while taking advantage of Rust’s safety guarantees and modern tooling.
Binary name:
oc-rsync(client and daemon in one binary). System packages can keep the originalrsyncinstalled side-by-side.
oc-rsync is approaching final stabilization: the core feature set is complete and production-ready, and current work focuses on edge cases, interoperability, and overall ergonomics.
Preliminary packages (.deb, .rpm, Homebrew formula, and tarballs) are available on the Releases page.
- Features
- Status
- Installation
- Usage
- Project layout
- Development
- Configuration & environment
- Logging
- Contributing
- License
- Acknowledgements
-
Protocol 32 parity
- Negotiation, tags, framing, and multiplexing modeled closely after upstream
rsync(3.4.x). - Designed to interoperate with existing
rsyncdaemons and clients (both directions).
- Negotiation, tags, framing, and multiplexing modeled closely after upstream
-
CLI & UX parity
- Command-line surface modeled after
rsync, including exit codes and user-facing messages. --versionand--helpoutputs are structured to closely match upstream while exposing Rust-specific details.
- Command-line surface modeled after
-
Single native binary
- Client, server (
--server), and daemon (--daemon) roles are implemented in Rust within theoc-rsyncbinary. - No delegation to a system
rsyncbinary is required or supported for normal operation.
- Client, server (
-
Rust safety & performance
- Memory-safe implementation using idiomatic Rust.
- Hot path I/O and checksum operations are structured for future SIMD/vectorization work.
-
Composed workspace
- Multiple crates separate concerns:
clifor argument parsing and user experience.corefor shared types, error model, and utilities.protocolfor wire format, tags, and negotiation.enginefor file list and data pump pipelines.daemonfor rsync-style daemon behavior.filters,checksums,bandwidthfor independent subsystems.
- Multiple crates separate concerns:
-
Strict hygiene
cargo fmtandcargo clippyenforced in CI with-D warnings.- Documentation and README validation via
xtaskto keep public docs in sync with code.
- Upstream baseline: tracking
rsync3.4.1 (protocol 32). - Rust-branded release line: 3.4.1-rust.
- Stability: alpha/early-beta; most day-to-day flows are implemented, with ongoing work on edge cases, performance, and polish.
Prebuilt artifacts are (or will be) published on the GitHub Releases page (Deb/RPM packages and tarballs, across multiple platforms/architectures).
- Go to: https://github.com/oferchen/rsync/releases
- Download the asset for your OS/arch (e.g.,
.deb,.rpm, or.tar.*). - Install it using your platform’s package manager or by extracting the tarball.
The packaging pipeline installs oc-rsync under dedicated paths so that the system rsync can remain installed in parallel.
You can install oc-rsync via Homebrew from the custom tap:
# Add the tap (one-time)
brew tap oferchen/rsync https://github.com/oferchen/rsync
# Install oc-rsync
brew install oferchen/rsync/oc-rsyncTo upgrade to the latest released version:
brew update
brew upgrade oferchen/rsync/oc-rsyncAfter installation, confirm that the binary is available and reports the expected Rust-branded version:
oc-rsync --versionRequirements:
- Rust toolchain 1.88 (or newer compatible with the workspace).
Clone and build:
git clone https://github.com/oferchen/rsync.git
cd rsync
# Debug build
cargo build --workspace
# Optimized build
cargo build --workspace --releaseTo match the documented toolchain:
rustup toolchain install 1.88.0
rustup default 1.88.0
cargo build --workspace --all-featuresThe primary entrypoint binary is oc-rsync (client and daemon).
oc-rsync is designed to behave like rsync, so existing rsync muscle memory should mostly apply.
Local directory sync:
oc-rsync -av ./source/ ./dest/Remote pull:
oc-rsync -av user@host:/remote/path/ ./local/path/Remote push:
oc-rsync -av ./local/path/ user@host:/remote/path/Stats, progress, and other flags follow upstream semantics wherever possible.
Run as a daemon:
oc-rsync --daemon --config=/etc/oc-rsyncd/oc-rsyncd.confDefault daemon configuration example path:
/etc/oc-rsyncd/oc-rsyncd.conf
The daemon mode is intended to interoperate with upstream rsync clients and daemons.
High-level workspace structure:
bin/oc-rsync/ # Client + daemon entry (binary crate)
crates/cli/ # CLI: flags, help, UX parity
crates/core/ # Core types, error model, shared utilities
crates/protocol/ # Protocol v32: negotiation, tags, framing, IO
crates/engine/ # File list & data pump pipelines
crates/daemon/ # Rsync-like daemon behaviors
crates/filters/ # Include/exclude pattern engine
crates/checksums/ # Rolling & strong checksum implementations
crates/bandwidth/ # Throttling/pacing primitives
docs/ # Design notes, internal docs
tools/ # Dev utilities (e.g., enforce_limits.sh)
xtask/ # Developer tasks: docs validation, packaging helpers
AGENTS.md # Internal agent roles & conventions
-
Rust toolchain 1.88.0 (managed via
rust-toolchain.toml). -
cargo-nextestfor running the test suite:cargo install cargo-nextest --locked
A helper script (
scripts/install-nextest.sh) installs the locked dependency set for environments that don't have a recent toolchain. -
cargo-llvm-covif you want to generate coverage reports locally.
# Format (check mode)
cargo fmt --all -- --check
# Clippy (deny warnings)
cargo clippy --workspace --all-targets --all-features --no-deps -D warningsThese are enforced in CI to keep the codebase consistent and warning-free.
# Unit + integration tests
cargo nextest run --workspace --all-features
# Convenience wrapper (falls back to `cargo test` if `cargo-nextest` is missing)
cargo xtask testExample coverage flow (LLVM based):
cargo llvm-cov clean
cargo llvm-cov --workspace --lcov --output-path lcov.infoWhere enabled, CI may enforce coverage gates to avoid regressions.
An interop harness exercises both directions against upstream rsync releases (e.g., 3.0.9, 3.1.3, 3.4.1):
- Upstream
rsyncclient →oc-rsync --daemon oc-rsyncclient → upstreamrsyncdaemon
Look under tools/ci/ for the relevant scripts and pinned upstream versions.
Example smoke test:
# Replace host/module with your upstream rsyncd endpoint
cargo run --bin oc-rsync -- -av rsync://host/module/ /tmp/sync-testDocumentation and policy checks are wired via xtask:
# Validate README and docs (anchors, headings, fenced blocks, link sets as configured)
cargo xtask docs
# Source/policy limits
bash tools/enforce_limits.sh
# One-liner: fmt + clippy + tests + docs
cargo fmt --all -- --check \
&& cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings \
&& cargo nextest run --workspace --all-features \
&& cargo xtask docsThis keeps public docs and internal invariants in sync with the codebase.
Release builds use a dedicated dist profile and xtask packaging helpers:
# Build optimized binaries (dist profile)
cargo build --workspace --profile dist --locked
# Produce Debian, RPM, and tarball artifacts for the host platform
cargo xtask package --release
# Only tarballs (e.g., for macOS cross-build hosts)
cargo xtask package --release --tarball
# Restrict tarball generation to a specific target triple
cargo xtask package --release --tarball --tarball-target x86_64-apple-darwinCI publishes artifacts across:
- Linux (
x86_64/aarch64).deb/.rpm - macOS and Windows tarballs (for supported targets)
- CycloneDX SBOM built from the same
distbinaries.
Defaults aim to mirror upstream rsync semantics wherever possible. Flags and environment variables follow upstream names when feasible.
For a full overview of supported options:
# Client options
oc-rsync --help
# Daemon options
oc-rsync --daemon --help- Structured logs with standard levels:
error,warn,info,debug,trace. - Human-oriented progress output follows
rsyncUX conventions. - Diagnostics reference Rust module/function paths instead of C file/line pairs while preserving the same level of precision.
Contributions, bug reports, and interop findings are very welcome.
-
Fork the repository and create a feature branch.
-
Run the full hygiene pipeline:
cargo fmt --all -- --check cargo clippy --workspace --all-targets --all-features --no-deps -D warnings cargo nextest run --workspace --all-features cargo xtask docs
-
Open a pull request with a clear description of:
- Behavioral changes (especially vs upstream
rsync) - New flags or configuration knobs
- Any interop impact or protocol changes
- Behavioral changes (especially vs upstream
Please keep changes focused and align with the existing crate split and error handling patterns.
This project is licensed under the GNU GPL v3.0 or later.
See LICENSE for the full text.
Inspired by the original rsync by Andrew Tridgell and the Samba team, and by the broader Rust ecosystem that made this re-implementation feasible.