Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
sync0
sync0 is a command line tool for transferring files across networks, incrementally synchronizing directories, and concurrently distributing data to multiple machines.
- Original design intention
- Speed comparison with rsync
- Performance improvement methods
- Install
- User Guide
Original design intention
In cross-machine rooms, countries, or environments with network delays and packet loss, tools such as rsync and scp are based on single connection sequence confirmation, which limits bandwidth utilization; when multiple machines pull data from the same server at the same time, the source server network card can easily become a bottleneck.
The goal of sync0 is to solve two problems:
- Let the file and directory synchronization between the two machines run full physical bandwidth, and only transfer the changed part when the file is partially modified.
- Multiple machines can transfer data blocks to each other when synchronizing the same directory, reducing the load on the source server and shortening the overall synchronization time.
Speed comparison with rsync
Test environment: European node $\leftrightarrow$ North American node, round-trip delay 86 ms, measuring the complete time-consuming including directory scanning, deduplication comparison, network transmission and disk placement verification:
| Transmission scenario | Data size | sync0 |
rsync |
Multiple |
|---|---|---|---|---|
| 10,000 small files | 77.6 MB | 0.90 s (688 Mbps) | 4.86 s (128 Mbps) | 5.4x |
Code and archive packages (.tar) |
512 MB | 1.94 s (2111 Mbps) | 9.36 s (438 Mbps) | 4.8x |
Video file (.mp4) |
512 MB | 7.36 s (556 Mbps) | 12.11 s (338 Mbps) | 1.6x |
| Incremental synchronization (modify 1% content) | 512 MB | 0.12 s | 1.85 s | 15.4x |
Performance improvement methods
- UDP concurrent transmission: Send data blocks through UDP, and only retransmit lost fragments to avoid a single packet loss blocking subsequent file transfers.
- Content segmentation and deduplication: Split the file into data blocks according to content and calculate the check value. The same content already on the receiving end is reused directly locally without duplicating the network.
- Automatically adjust compression according to network speed: Turn on compression for compressible content such as text and code; automatically skip compression for videos, pictures, compressed packages or under high-speed LAN to reduce CPU consumption.
- Multi-node nearby pulling: When multiple machines pull the same directory, data blocks will be pulled concurrently from downloaded nodes in the same city or with lower latency.
Install
Method 1: Install via Cargo
Method 2: Download precompiled binaries
Go to GitHub Releases to download the .tar.xz compressed package for the corresponding system (supports Linux x86_64/ARM64, macOS Apple Silicon/Intel, Windows x64/ARM64, Android ARM64/x86_64, FreeBSD, NetBSD). After unzipping, place sync0 into the PATH directory:
User Guide
1. Directly transfer files or directories between two machines
Start monitoring on the receiving machine and specify the receiving and saving path:
Send a single file or an entire directory from the sending machine:
Commonly used parameters:
# Delete redundant files that exist on the receiving end but not on the sending end (mirror synchronization)
# Limit sending rate (unit: bytes/second, for example 50 MB/s)
# Silent mode (no progress bar shown)
2. Publishing shared directories and pulling from multiple nodes
Publish a shared directory (named dataset) on the origin server:
Pull the shared directory on other machines (you can fill in multiple node addresses at the same time, separated by commas to pull concurrently):
Pull only a certain subdirectory in the shared directory:
Push local changes back to the remote shared directory:
3. Subscribe to catalog automatic updates
Subscribe to the shared directory of the source node. When a file is added or modified in the source directory, it will automatically be synchronized to the local computer. At the same time, the local machine will automatically serve as a node for other machines to pull:
4. Two-way synchronization of multi-machine groups
Multiple machines join the same group name, and changes in any node directory will be automatically synchronized to other nodes in the group:
5. Node identity and personal business card
Each node supports setting the user name, city, email, website and a personalized signature (maximum 256 characters), and passes the local private key signature authentication:
# View the local public key ID (specify the configuration directory to persist the key)
# Generate and display node business cards with personalized signatures
share, pull, sub, group can also be launched with these profile parameters:
6. Multi-language switching
sync0 Supports 75 languages. By default, command line help and prompts in the corresponding language are automatically displayed according to the language environment of the operating system; if the system language is not in the supported list, English is used by default.
To specify the language manually, set the environment variable SYNC0_LANG:
SYNC0_LANG=en
SYNC0_LANG=ja
SYNC0_LANG=de