This project presents a re-implementation of the classic rsync tool, built entirely in Rust. It offers wire compatibility with upstream rsync, ensuring seamless integration as a drop-in replacement. With full support for local, SSH, and daemon transfers, it preserves metadata and supports advanced features, all while optimizing performance.
oc-rsync: Pure Rust Implementation of rsync
oc-rsync offers a comprehensive re-implementation of the classic rsync in pure Rust, ensuring wire compatibility with upstream rsync version 3.4.1 (protocol 32). As a drop-in replacement, it allows seamless integration alongside the system's existing rsync.
Key Features
- Fully Functional Transfers: Supports local, SSH, and daemon file transfers with a native delta algorithm.
- Metadata Preservation: Ensures that all core options, including metadata, are preserved during transfers.
- Interoperability: Tested against multiple upstream
rsyncversions, ensuring compatibility.
| Feature | Status |
|---|---|
| Local copy | Complete |
| SSH transfer | Complete |
| Daemon negotiation & auth | Complete |
| Delta algorithm | Complete |
| Sparse files, hardlinks, symlinks | Complete |
| Compression (zlib, zstd, lz4) | Complete |
| Incremental recursion | Pending |
| Windows support | Partial |
Performance
oc-rsync employs a threaded architecture, replacing the traditional fork-based pipeline used in upstream rsync. This design choice minimizes system call overhead and context switching, resulting in enhanced performance for local transfers.
Benchmark Results

Usage
The command-line interface is designed to be user-friendly, mirroring the functionality of rsync. Examples include:
# Local sync
oc-rsync -av ./source/ ./dest/
# Remote pull
oc-rsync -av user@host:/remote/path/ ./local/
# Remote push
oc-rsync -av ./local/ user@host:/remote/path/
# Daemon mode
oc-rsync --daemon --config=/etc/oc-rsyncd/oc-rsyncd.conf
For a full list of supported options, run oc-rsync --help.
Development
To contribute to the project, ensure the following prerequisites are in place:
- Rust version 1.88.0 or higher.
- Install
cargo-nextestfor enhanced testing capabilities.
Project Structure
The project is organized into several crates, each handling a specific functionality:
- cli/: Manages command-line flags and output formatting.
- core/: Facilitates orchestration and session management.
- daemon/: Handles the daemon mode operations, including access control.
For complete API documentation, refer to cargo doc --workspace --no-deps --open.
Security
oc-rsync adheres to strict security measures, enforcing safety across protocol parsing and minimizing the use of unsafe code. Known vulnerabilities from upstream rsync are addressed, ensuring a secure file transfer environment. For detailed security practices, refer to SECURITY.md.
Contributing
Contributions are encouraged; potential contributors should fork the repository, create a feature branch, and adhere to coding standards prior to submitting a pull request.
No comments yet.
Sign in to be the first to comment.